Re: escaping characters

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Just use stripslashes function.

Il giorno 13/giu/2010, alle ore 16.09, steve miller <steve@xxxxxxxxxx>  
ha scritto:

> Oops; wasn't complete in my question!
>
> I don't have a problem in browsers because they ignore the backslash
> if I leave it in.
> The problem is when I am creating an email because the email
> applications don't ignore the backslash, but show it as \" or \' so I
> have to remove them.
>
>
> Steve
>
>
>
> On Jun 13, 2010, at 9:49 AM, steve miller wrote:
>
>> I have a simple but perplexing problem I could use some help with.
>>
>> I am storing user text input strings in mysql, and am escaping ' and
>> " with addslashes.
>> When I pull them out and use stripslashes, I sometimes get errors
>> because I don't know if they have a ' or a " in the string.
>>
>> Example 1
>> String is: I'm cool
>> This works: echo "I'm cool";
>> This does not: echo 'I'm cool';
>>
>> Example 2
>> String is: You are "cool"
>> This works: echo 'You are "cool"';
>> This does not: echo "You are "cool"";
>>
>> Example 3
>> String is: I'm "cool"
>> This does not work: echo "I'm "cool"";
>> This does not work: echo 'I'm "cool"';
>>
>> So, how do I output strings of unknown content?
>>
>> Thanks for any guidance.
>>
>> Steve
>>
>
>
>
> [Non-text portions of this message have been removed]
>
>
>
> ------------------------------------
>
> Are you looking for a PHP job?
> Join the PHP Professionals directory Now!
> http://www.phpclasses.org/jobs/
> Yahoo! Groups Links
>
>
>

[Index of Archives]     [PHP Home]     [PHP Users]     [PHP Soap]     [Kernel Newbies]     [Yosemite]     [Yosemite Campsites]

  Powered by Linux