php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #3893 strtok can't tok \t\t (2 tabs)
Submitted: 2000-03-22 08:39 UTC Modified: 2002-10-01 15:57 UTC
From: ttj at mark dot ee dot nctu dot edu dot tw Assigned:
Status: Wont fix Package: Misbehaving function
PHP Version: 3.0.15 OS: FreeBSD 3.3R
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: ttj at mark dot ee dot nctu dot edu dot tw
New email:
PHP Version: OS:

 

 [2000-03-22 08:39 UTC] ttj at mark dot ee dot nctu dot edu dot tw
<?
//if the following words seperated by 2 continuous TAB char
$line="This             is              a               test";
$token=strtok($line,"\t\t");
while($token){
  echo "$token<br>";
  $token=strtok("\t\t");
}
?> 
expecting result should be:
This
is
a
test
but it's not.
Though there is other solution to this problem still,
str_replace \t\t -> \t 
or using explode

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-10-01 15:57 UTC] hholzgra@php.net
We are sorry, but can not support PHP 3 related problems anymore.
Momentum is gathering for PHP 5, and we think supporting PHP 3 will
lead to a waste of resources which we want to put into getting PHP 5
ready. Ofcourse PHP 4 will will continue to be supported for the
forseeable future.

works in php 4
 
PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Sat Nov 28 02:01:26 2020 UTC