Justtechjobs.com Find a programming school near you






Online Campus Both


php-developer-list | 2001041

[PHP-DEV] Bug #10314: split() function is'nt stable From: ttttntl <email protected>
Date: 04/13/01

From: ttttntl <email protected>
Operating system: Linux Redhat 7
PHP version: 4.0.4pl1
PHP Bug Type: *Regular Expressions
Bug description: split() function is'nt stable

Hi,

I use split function to seprate two parts of a .php file content(size 6KB), but the second array variable some times includes extra strange characters at the end. These characters are not in the string content!
Ex:
$globalcontent=fread($dfile, filesize($globalfile));
$array = split("startreplace(.*)endreplace", $globalcontent);
echo htmlentities($array[0])."<br><font color=red>------<br></font>".htmlentities($array[1]);
----------------
The first time running split() almost return result exactly, but when I re-run the script file, each time re-run, it adds some strange charaters into the end value of the second variable ($array[1])
- end of content of $globalcontent is "?>"
- but end of content of $array[1] some times is "?>gu", another time is "?> i", ...
----------------

-- 
Edit Bug report at: http://bugs.php.net/?id=10314&edit=1

-- PHP Development Mailing List <http://www.php.net/> To unsubscribe, e-mail: php-dev-unsubscribe <email protected> For additional commands, e-mail: php-dev-help <email protected> To contact the list administrators, e-mail: php-list-admin <email protected>