nine72 Posted February 19, 2008 Share Posted February 19, 2008 ok, so I have this form(s)...saving the input to the session. I need to take what is saved in the session strip special characters and then have it return back the var that I state it equals. exp. $_SESSION['agentId'] = $agentId - need to strip special characters at this point then enter the stripped var into a new string $xmlString .= "<agent>" . $agentId . "</agent>"; I need to do this some 400+ times... Thanks in advance.... Link to comment https://forums.phpfreaks.com/topic/91874-strip-special-characters-from-_session-var/ Share on other sites More sharing options...
Chris92 Posted February 19, 2008 Share Posted February 19, 2008 htmlspecialenitities() Link to comment https://forums.phpfreaks.com/topic/91874-strip-special-characters-from-_session-var/#findComment-470497 Share on other sites More sharing options...
craygo Posted February 19, 2008 Share Posted February 19, 2008 can try this function http://nadeausoftware.com/articles/2007/09/php_tip_how_strip_html_tags_web_page Ray Link to comment https://forums.phpfreaks.com/topic/91874-strip-special-characters-from-_session-var/#findComment-470505 Share on other sites More sharing options...
nine72 Posted February 19, 2008 Author Share Posted February 19, 2008 thanks for the susguestions they are both intresting possiblities... would it work if I did something along this line... $_SESSION['agentId'] = $agentId $agentId = preg_replace("/[^a-zA-Z0-9s]/", "", $agentId); or somthing like if (!isset($_SESSION['agentId']), ereg("[0-9!@#$%^&*()]", $agentId)) { $xmlString .= "<agent>" . $agnetId . "</agent>"; } or am I just WAYYY off.... Link to comment https://forums.phpfreaks.com/topic/91874-strip-special-characters-from-_session-var/#findComment-470541 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.