php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #20754 PROBLEM WITH SPLIT FUNCTION
Submitted: 2002-12-01 20:36 UTC Modified: 2002-12-01 21:16 UTC
From: ahhsee at ntu dot edu dot sg Assigned:
Status: Not a bug Package: Strings related
PHP Version: 4.2.3 OS: Win 2k
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: ahhsee at ntu dot edu dot sg
New email:
PHP Version: OS:

 

 [2002-12-01 20:36 UTC] ahhsee at ntu dot edu dot sg
I was trying to split the string with the splitter "\", but it gives me this error message: 
"Warning: REG_EESCAPE:wtrailing backslash (\) in E:\Inetpub\wwwroot\test\split.php on line 8"

MY SCRIPT: 

$mytest  =  "STAFF\Tester";
$arr = split ("\\", $mytest);  //--> ERROR!

Please help!


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-12-01 20:56 UTC] sniper@php.net
Your regex is broken, it should be:

$arr = split ("\\\\", $mytest);
 [2002-12-01 21:06 UTC] ahhsee at ntu dot edu dot sg
sorry, didnt know i have to put 2 escape characters for a for both escape character \ and search character '\'.

thanks :)
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Dec 22 11:01:30 2024 UTC