RE: [PHP-WIN] explode...
| From: | Charles P. Killmer | Date: | Thu, 29 May 2003 20:24:29 +0000 |
| Subject: | RE: [PHP-WIN] explode... | ||
| Groups: | php.windows | ||
| Request: | Send a blank email to php-windows+get-20135@lists.php.net to get a copy of this message | ||
It returns an array with one element.
<?
$test = explode("no commas",",");
echo $test;
echo $test[0];
?>
Array
no commas
-----Original Message-----
From: David Martinez [mailto:david@sojournmusic.net]
Sent: Thursday, May 29, 2003 3:13 PM
To: php-windows@lists.php.net
Subject: [PHP-WIN] explode...
Here is the explode function: explode($delimiter, $string); This
function looks in $string for the specified delimiter then splits up
$string by $delimiter and returns those values into an array.
I am using the explode() function to divide up a string into an array by
commas. According to the PHP.net documentation, if the string passed to
explode() does not have an instance of the specified $delimiter, the
function will return the value of $string. However, I find when I use
the function, if the specified $delimiter does not exist, explode()
simply returns the word "Array."
Any ideas as to why this is?
--Dave
--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php