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
https://forums.phpfreaks.com/topic/41580-can-i-strip-slashes-using-this-syntax/
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";
?>

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.