note 38576 deleted from function.strtok by nlopess

From: Date: Sun, 28 Dec 2003 13:18:05 +0000
Subject: note 38576 deleted from function.strtok by nlopess
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-62601@lists.php.net to get a copy of this message
Note Submitter: webmaster at theluxuryhotels dot info ---- 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

« previous php.notes (#62601) next »