note 38576 added to function.strtok

From: Date: Sun, 28 Dec 2003 12:16:25 +0000
Subject: note 38576 added to function.strtok
Groups: php.notes 
Request: Send a blank email to php-notes+get-62598@lists.php.net to get a copy of this message
Don't know if the error is on my side or if there is really a bug in PHP 4.2.3. Here comes a snippet: // test snippet $teststring="Venice - Budapest<TAB> 2,530 EUR<TAB> 1,585 EUR<TAB> 3,290 EUR"; $tok = strtok ($teststring,"<TAB>"); while ($tok) { echo "Teilstring= $tok<br>"; $tok = strtok ("<TAB>"); } This should produce the following output: Teilstring= Venice - Budapest Teilstring= 2,530 EUR Teilstring= 1,585 EUR Teilstring= 3,290 EUR But what you get is Teilstring= Venice - Teilstring= 2,530 EUR Teilstring= 1,585 EUR Teilstring= 3,290 EUR Not only the string "<TAB>" but also the capital letter "B" is accepted as delimiter. Where am I wrong? Frank from Austria webmaster of http://www.orient-express-reisen.de ---- Manual Page -- http://www.php.net/manual/en/function.strtok.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+38576 Delete -- http://master.php.net/manage/user-notes.php?action=delete+38576&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+38576&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#62598) next »