|   | php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login | 
| 
  [2002-10-31 21:38 UTC] tea at softhome dot net
 let say:
$_SESSION["l"] = 'c/c++';
$_SESSION["l"] = preg_replace("/\\*\/","\/",$_SESSION["l"]);
$_SESSION["l"] = preg_replace("/\\*\+","\+",$_SESSION["l"]);
what i expect is no matter how the user reload the page
$_SESSION["l"] should be 'c\/c\+\+'
i used the reg exp in perl and tried it out, seems logically correct, but it cause an error in my php page.
thx for your attention
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits             | |||||||||||||||||||||||||||
|  Copyright © 2001-2025 The PHP Group All rights reserved. | Last updated: Thu Oct 30 23:00:01 2025 UTC | 
sorry, a typo in the second line of code $_SESSION["l"] = preg_replace("/\\*\//","\/",$_SESSION["l"]); i missed a '/'.line 3 also.... missed a '/' :( $_SESSION["l"] = 'c/c++'; $_SESSION["l"] = preg_replace("/\\*\//","\/",$_SESSION["l"]); $_SESSION["l"] = preg_replace("/\\*\+/","\+",$_SESSION["l"]);