simcoweb Posted March 7, 2007 Share Posted March 7, 2007 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 More sharing options...
btherl Posted March 7, 2007 Share Posted March 7, 2007 The answer is no You can do echo "blah" . stripslashes($step1) . "blah", or you can put the output of stripslashes into variables and put those directly into the echoed string. Link to comment https://forums.phpfreaks.com/topic/41580-can-i-strip-slashes-using-this-syntax/#findComment-201495 Share on other sites More sharing options...
simcoweb Posted March 7, 2007 Author Share Posted March 7, 2007 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 https://forums.phpfreaks.com/topic/41580-can-i-strip-slashes-using-this-syntax/#findComment-201498 Share on other sites More sharing options...
btherl Posted March 7, 2007 Share Posted March 7, 2007 Yep, exactly. You missed it on the first line though. Link to comment https://forums.phpfreaks.com/topic/41580-can-i-strip-slashes-using-this-syntax/#findComment-201499 Share on other sites More sharing options...
simcoweb Posted March 7, 2007 Author Share Posted March 7, 2007 Ok, cool. Rock on and thanks! Link to comment https://forums.phpfreaks.com/topic/41580-can-i-strip-slashes-using-this-syntax/#findComment-201501 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.