Hi Marian,
<?php
$text = 'Does "this" convert "all" the "double" quotes?';
$text = str_replace('"', "'", $text);
echo $text;
?>
In str_replace:
single quote, double quote, single quote
then:
double quote, single quote, double quote
----- Original Message -----
From: "Marian Briones" <[EMAIL PROTECTED]>
To: <[email protected]>
Sent: Thursday, November 24, 2005 4:28 PM
Subject: [php-list] How to replace double quotes with single quotes
>I am writing a page that outputs a bunch of JavaScript lines, and the
> stuff coming out of the database contains double quotes, which must be
> single quotes in order for my Javascript to work. (It's a scrolling
> news box).
>
> I tried str_replace and preg_replace and had bad results.
>
> How do I do this? There **must** be a way. Thanks, and Happy Turkey
> Day to those of us who celebrate it!
>
> Marian
>
>
>
>
>
>
> Community email addresses:
> Post message: [email protected]
> Subscribe: [EMAIL PROTECTED]
> Unsubscribe: [EMAIL PROTECTED]
> List owner: [EMAIL PROTECTED]
>
> Shortcut URL to this page:
> http://groups.yahoo.com/group/php-list
> Yahoo! Groups Links
>
>
>
>
>
>
------------------------ Yahoo! Groups Sponsor --------------------~-->
Get fast access to your favorite Yahoo! Groups. Make Yahoo! your home page
http://us.click.yahoo.com/dpRU5A/wUILAA/yQLSAA/HKFolB/TM
--------------------------------------------------------------------~->
Community email addresses:
Post message: [email protected]
Subscribe: [EMAIL PROTECTED]
Unsubscribe: [EMAIL PROTECTED]
List owner: [EMAIL PROTECTED]
Shortcut URL to this page:
http://groups.yahoo.com/group/php-list
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/php-list/
<*> To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/