mzhou88 Posted March 19, 2007 Share Posted March 19, 2007 preg_replace("/{$match}{$_Conf['FileManip']['Splitter']}(\d+)/i","{$match}{$_Conf['FileManip']['Splitter']}".$1+1,$Read) Currently I am trying to figureout how to add 1 to the (\d+). but when i do whatever i did just now, it gives me this error: Parse error: syntax error, unexpected T_LNUMBER, expecting T_VARIABLE or '$' in D:\xampplite\htdocs\includes\bbcode.php on line 134 thx =p Quote Link to comment Share on other sites More sharing options...
effigy Posted March 19, 2007 Share Posted March 19, 2007 I think the $1 has to be in quotes, which requires the /e modifier to do the addition: <pre> <?php $string = '1'; echo preg_replace('/(\d+)/e', "$1+1", $string); ?> </pre> Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.