Re: addslashes ()
| From: | Daniel Convissor | Date: | Mon, 16 Oct 2000 16:37:20 +0000 |
| Subject: | Re: addslashes () | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-20424@lists.php.net to get a copy of this message | ||
Hi Senthil:
> i have a problem . i want to add slashes to my string
> $a = senthil ...i want it like 'senthil'
>
> i did $a=addslashes($a);
> but nothing worked ..
> 1.i have magic quotes = off..
> 2.is there a way to print ' and "
addslashes() does what it's name says: it adds slashes. You want to add
quotes. That's a whole different story.
I'm not sure exactly what your goal is, but you can try this:
$a = "senthil"; # Initial value.
$a = "\'$a\'"; # Add single quote to beginning and end of $a.
Enjoy,
--Dan
--
PHP scripts that make your job easier
http://www.analysisandsolutions.com/code/
SQL Solution | Layout Solution | Form Solution
T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y
4015 7 Ave, Brooklyn NY 11232 v: 718-854-0335 f: 718-854-0409