explode and PATH_SEPARATOR

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Taking this code:

<pre>
<?php

define (PATH_SEPARATOR, "/");

$String="Root/One/Two/Three/Last";

$arr = explode ( PATH_SEPARATOR, $String );
var_dump ( $arr );

$arr = explode ( "/", $String );
var_dump ( $arr );
?>
</pre>

It works fine in second case returing a five elements array, but in the first one it returns an array with just one elemen that's the source string itself. I've test it also changing PATH_SEPARATOR by SEPARATOR in both cases, and it works nice... Is PATH_SEPARATOR any kind of reserved word or so?

Thx.

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


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux