Jump to content

Can I strip slashes using this syntax?


simcoweb

Recommended Posts

Should be simple question but just want to make sure since i've only used stripslashes in a different manner of output. Here's what I have in mind. This list will be echoed to the browser showing updated information. I'm using mysql_real_escape_string for the insertion of the data and want to strip the slashes for this output:

 

<?php
echo "<ul><li>Step 1: stripslashes($step1)</li>
 <li>Step 2: stripslashes($step2)</li>
 <li>Step 3: stripslashes($step3)</li>
 <li>Step 4: stripslashes($step4)</li>
 <li>Details: stripslashes($details)</li>
 <li>Extra Pick #1: stripslashes($extra_pick1)</li>\n
 <li>Extra Pick #2: stripslashes($extra_pick2)</li>\n
 <li>Extra Pick #3: stripslashes($extra_pick3)</li>\n
 <li>Extra Pick #4: stripslashes($extra_pick4)</li>\n
 </ul><br>\n";
?>

 

It looks funky in my PHP editor in regards to the color coding.

Link to comment
Share on other sites

Thanks for the post. Ok, so if i'm understanding correctly, i'd have to do it this way?

 

<?php
echo "<ul><li>Step 1: stripslashes($step1)</li>
				             <li>Step 2: " . stripslashes($step2) . "</li>
							 <li>Step 3: " . stripslashes($step3) . "</li>
							 <li>Step 4: " . stripslashes($step4) . "</li>
							 <li>Details: " . stripslashes($details) . "</li>
							 <li>Extra Pick #1: " . stripslashes($extra_pick1) . "</li>\n
							 <li>Extra Pick #2: " . stripslashes($extra_pick2) . "</li>\n
							 <li>Extra Pick #3: " . stripslashes($extra_pick3) . "</li>\n
							 <li>Extra Pick #4: " . stripslashes($extra_pick4) . "</li>\n
							 </ul><br>\n";
?>

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.