Re: [PHP] replacing first occurence

2002-04-24 Thread Philip Olson
> What function can I use to replace just the first occurence > of a "," in a string? Let's replace the first , with a ! and if , does not exist at all let's not replace anything. Change according to taste: $str = 'Hello, I love you!'; if (($pos = strpos($str, ',')) !== false) {

RE: [PHP] replacing first occurence

2002-04-24 Thread Steve Bradwell
http://www.php.net/manual/en/function.ereg-replace.php -Steve. -Original Message- From: Diana Castillo [mailto:[EMAIL PROTECTED]] Sent: Wednesday, April 24, 2002 12:09 PM To: [EMAIL PROTECTED] Subject: [PHP] replacing first occurence What function can I use to replace just the first

RE: [PHP] replacing first occurence

2002-04-24 Thread Maxim Maletsky \(PHPBeginner.com\)
ncerely, Maxim Maletsky Founder, Chief Developer www.PHPBeginner.com // where PHP Begins -Original Message- From: Diana Castillo [mailto:[EMAIL PROTECTED]] Sent: Wednesday, April 24, 2002 6:09 PM To: [EMAIL PROTECTED] Subject: [PHP] replacing first occurence What function can I u

[PHP] replacing first occurence

2002-04-24 Thread Diana Castillo
What function can I use to replace just the first occurence of a "," in a string? Thank you -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php