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. Quote Link to comment 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. Quote Link to comment 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"; ?> Quote Link to comment 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. Quote Link to comment Share on other sites More sharing options...
simcoweb Posted March 7, 2007 Author Share Posted March 7, 2007 Ok, cool. Rock on and thanks! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.