Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>There is merit in the other answers, but to me it looks like what you're actually trying to accomplish is something very different. In the php code <code>\\\'</code> is not three slashes followed by an apostrophe, it's one escaped slash followed by an escaped apostrophe, and in the rendered output, that's exactly what you see&mdash;a slash followed by an apostrophe (with no need to escape them in the rendered html). It's important to realize that the escape character is not <em>actually</em> part of the string; it's merely a way to help you represent a character that normally has very different meaning in within php&mdash;in this case, an apostrophe normally terminates a string literal. What looks like 4 characters in php is actually only 2 characters in the string.</p> <p>If this is the extent of your code, there's no need for string manipulation or regular expressions. What you actually need is just this:</p> <pre><code>&lt;?php $str='&lt;li&gt; &lt;span class="highlight"&gt;Color&lt;/span&gt; Can\'t find the exact color shown on the model pictures? Just leave a message (eg: color as shown in the first picture...) when you place order. Please note that colors on your computer monitor may differ slightly from actual product colors depending on your monitor settings. &lt;/li&gt;'; echo $str; ?&gt; </code></pre> <p>Only one escape character is needed here for the apostrophe, and in the rendered HTML you will see no slashes at all.</p> <p><strong>Further Reading:</strong></p> <ul> <li><a href="http://php.net/manual/en/regexp.reference.escape.php" rel="nofollow">Escape sequences</a></li> </ul>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload