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 Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or 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

Add a Patch

Pull Requests

Add a Pull Request

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-2023 The PHP Group
All rights reserved.
Last updated: Sun Jun 11 00:03:38 2023 UTC