jmichael68 Posted October 24, 2006 Share Posted October 24, 2006 I'm having some trouble replacing a parenthesis in my string. Here is one variation of what I've already tried.$text = ')FOOTBALL';$numer12 = '';$text = ereg_replace('/)/';, $numer12, $text);Does anyone have a quick fix for my problem?Thanks Link to comment https://forums.phpfreaks.com/topic/24979-using-ereg_replace-with-parenthesis/ Share on other sites More sharing options...
Caesar Posted October 24, 2006 Share Posted October 24, 2006 [code]<?php $string = ')Football'; $numer12 = ''; $new = str_replace(")",$numer12,$string); echo"$new";?>[/code] Link to comment https://forums.phpfreaks.com/topic/24979-using-ereg_replace-with-parenthesis/#findComment-113859 Share on other sites More sharing options...
jmichael68 Posted October 24, 2006 Author Share Posted October 24, 2006 I get this messageParse error: syntax error, unexpected T_STRING in /webroot/s/u/supfr001/ssl/functions.php on line 895also $string is part of an array. Link to comment https://forums.phpfreaks.com/topic/24979-using-ereg_replace-with-parenthesis/#findComment-113898 Share on other sites More sharing options...
Caesar Posted October 25, 2006 Share Posted October 25, 2006 That code definitely works (one I showed you). I would have to see a bigger sample of your code from the file that's yielding the parse error. Link to comment https://forums.phpfreaks.com/topic/24979-using-ereg_replace-with-parenthesis/#findComment-113987 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.