note 7694 added to AddSlashes

From: Date: Fri, 11 Aug 2000 17:20:07 +0000
Subject: note 7694 added to AddSlashes
Groups: php.notes 
Request: Send a blank email to php-notes+get-1317@lists.php.net to get a copy of this message
Also this may seem like trivial advice...: It's really important where to use addslashes() ! $str = "c:trickybackslashespath"; echo addslashes($str); ...won't escape the t at the beginning, effectively outputting c: ricky\backslashes\path because you already assigned the string containing a TAB _before_ using addslashes...! Correctly, the above should rather be $str = addslashes("c:trickybackslashespath"); echo $str; An alternative to this would be the usage of single quotes. Read the comment in the main string-functions section for more info on this. http://www.php.net/manual/function.addslashes.php

« previous php.notes (#1317) next »