Jump to content

Archived

This topic is now archived and is closed to further replies.

jmichael68

Using ereg_replace with parenthesis

Recommended Posts

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


Share this post


Link to post
Share on other sites


[code]<?php

  $string = ')Football';
  $numer12 = '';
 
  $new = str_replace(")",$numer12,$string);
 
  echo"$new";

?>[/code]

Share this post


Link to post
Share on other sites
I get this message

Parse error: syntax error, unexpected T_STRING in /webroot/s/u/supfr001/ssl/functions.php on line 895

also $string is part of an array.


Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.