Need similar function in PHP for this JavaScript function

Discussion in 'PHP' started by judesfernando, Apr 23, 2010.

  1. #1
    I need a similar function in PHP for this..

    text = text.replace(/ffc/g, "Hello");

    I think preg_replace will do, but i'm not sure how to write the expression..

    Thanks
     
    judesfernando, Apr 23, 2010 IP
  2. danx10

    danx10 Peon

    Messages:
    1,179
    Likes Received:
    44
    Best Answers:
    2
    Trophy Points:
    0
    #2
    <?php
    
    $text = str_replace('ffc', 'Hello', $text);
    
    ?>
    PHP:
     
    danx10, Apr 24, 2010 IP