Re: [PHP-DB] Why isn't this working?

2005-02-26 Thread graeme
For more efficient code try the explode() function (You really only want 
to use the regular expression functions for complex pattern matching, 
looking for a comma is about as simple as it gets so use the standard 
string functions)

explode (',',$Agent_Rep);
graeme.
Rasmus Lerdorf wrote:
Chris Payne wrote:
Hi everyone,
 

I’m trying to split a string by comma, but it’s not working, can you 
see any reason that the below doesn’t work?

 

$keywords = preg_split(',','$Agent_Rep');

Not sure why you sent this to php-db, but have another look at the 
preg_split documentation.  You need '/,/' there to split on a comma.

-Rasmus
--
Experience is a good teacher, but she sends in terrific bills.
Minna Antrim
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP-DB] Why isn't this working?

2005-02-26 Thread Rasmus Lerdorf
Chris Payne wrote:
Hi everyone,
 

I’m trying to split a string by comma, but it’s not working, can you see 
any reason that the below doesn’t work?

 

$keywords = preg_split(',','$Agent_Rep');
Not sure why you sent this to php-db, but have another look at the 
preg_split documentation.  You need '/,/' there to split on a comma.

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


[PHP-DB] Why isn't this working?

2005-02-26 Thread Chris Payne








Hi everyone,

 

I’m trying to split a string by comma, but it’s
not working, can you see any reason that the below doesn’t work?

 

$keywords = preg_split(',','$Agent_Rep');

 

Thanks

 

Chris






No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.300 / Virus Database: 266.5.0 - Release Date: 2/25/2005

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