Re: escaping characters

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

 



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

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/php-objects/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/php-objects/join
    (Yahoo! ID required)

<*> To change settings via email:
    php-objects-digest@xxxxxxxxxxxxxxx 
    php-objects-fullfeatured@xxxxxxxxxxxxxxx

<*> To unsubscribe from this group, send an email to:
    php-objects-unsubscribe@xxxxxxxxxxxxxxx

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/



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

  Powered by Linux