3raser Posted July 27, 2010 Share Posted July 27, 2010 My current code: $stripslashes_description = stripslashes($row_questions['description']); $stripslashes_description = nl2br($row_questions['description']); That doesn't seem to work. Is there another way to use multiple functions on one string, without having to make the variable again? Would it be something like: $description = stripslashes(nl2br($row_questions['description'])); Link to comment https://forums.phpfreaks.com/topic/208972-is-there-another-way-to-do-this/ Share on other sites More sharing options...
trq Posted July 27, 2010 Share Posted July 27, 2010 You could either do.... $stripslashes_description = stripslashes($row_questions['description']); $stripslashes_description = nl2br($stripslashes_description); or the equivalent: $description = nl2br(stripslashes($row_questions['description'])); Link to comment https://forums.phpfreaks.com/topic/208972-is-there-another-way-to-do-this/#findComment-1091525 Share on other sites More sharing options...
trq Posted July 27, 2010 Share Posted July 27, 2010 You could either do.... $stripslashes_description = stripslashes($row_questions['description']); $stripslashes_description = nl2br($stripslashes_description); or the equivalent: $description = nl2br(stripslashes($row_questions['description'])); ps: You really shouldn't need stripslashes to display data. Link to comment https://forums.phpfreaks.com/topic/208972-is-there-another-way-to-do-this/#findComment-1091527 Share on other sites More sharing options...
3raser Posted July 27, 2010 Author Share Posted July 27, 2010 You could either do.... $stripslashes_description = stripslashes($row_questions['description']); $stripslashes_description = nl2br($stripslashes_description); or the equivalent: $description = nl2br(stripslashes($row_questions['description'])); ps: You really shouldn't need stripslashes to display data. Uhm, well I use mysql_real_escape_string and I hate the \ every time there is a '. Link to comment https://forums.phpfreaks.com/topic/208972-is-there-another-way-to-do-this/#findComment-1091529 Share on other sites More sharing options...
trq Posted July 27, 2010 Share Posted July 27, 2010 If you escape your data properly no slashes end up in your data. If using mysql_real_escape_string is leaving slashes in your data you must already have magic quotes enabled. Disable it. Link to comment https://forums.phpfreaks.com/topic/208972-is-there-another-way-to-do-this/#findComment-1091551 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.