[PHP] regex to change ' to ?

2004-03-04 Thread Adam Williams
What would be the PHP expression to change any and all ' to ? in a 
variable?

I want to change any and all ' in $_POST[data] to ?

what would be the statement?  Thanks!

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] regex to change ' to ?

2004-03-04 Thread Richard Davey
Hello Adam,

Thursday, March 4, 2004, 3:36:06 PM, you wrote:

AW What would be the PHP expression to change any and all ' to ? in a
AW variable?

AW I want to change any and all ' in $_POST[data] to ?

$output_array = str_replace(', ?, $_POST);

Use this instead of a reg exp for such a simple task, it's quicker and
will cope with the whole array in one command.

-- 
Best regards,
 Richard Davey
 http://www.phpcommunity.org/wiki/296.html

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] regex to change ' to ?

2004-03-04 Thread Adam Williams
Thank you, that works great!

On Thu, 4 Mar 2004, Richard Davey wrote:

 Hello Adam,
 
 Thursday, March 4, 2004, 3:36:06 PM, you wrote:
 
 AW What would be the PHP expression to change any and all ' to ? in a
 AW variable?
 
 AW I want to change any and all ' in $_POST[data] to ?
 
 $output_array = str_replace(', ?, $_POST);
 
 Use this instead of a reg exp for such a simple task, it's quicker and
 will cope with the whole array in one command.
 
 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php