note 46308 added to function.addslashes

From: Date: Wed, 06 Oct 2004 15:18:42 +0000
Subject: note 46308 added to function.addslashes
Groups: php.notes 
Request: Send a blank email to php-notes+get-78068@lists.php.net to get a copy of this message
Another solution to Mark's problem below is to use the built in htmlentities(...) function that converts HTML special chars to their HTML entity codes (ie., " to &quot). This way you are also avoiding any other problems you may run into in the future with say single quotes or ampersands - both of which are converted to their HTML codes with this function. $str = "This is a \"test\" string."; htmlentities($str, ENT_QUOTES); echo $str; //This is a "test" string ---- Manual Page -- http://www.php.net/manual/en/function.addslashes.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+46308 Delete -- http://master.php.net/manage/user-notes.php?action=delete+46308&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+46308&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#78068) next »