preg_replace doesn't work properly

Discussion in 'PHP' started by computerzworld, Oct 17, 2008.

  1. #1
    Hello All,
    I am having one script that finds words from the paragraph and replace it with the same word alongwith the hyperlink with it using preg_replace function. This script works perfectly on my testing server but as soon as I moved it to live server the script doesn't work at all. So, is there any modifications required in php.ini or any extension that is needed to load in order to run this preg_replace function? Please help me. I got stuck at this point. Thanks in advance.
     
    computerzworld, Oct 17, 2008 IP
  2. webrickco

    webrickco Active Member

    Messages:
    268
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    60
    #2
    Since no external library is required to install it, have you check your version of PHP on the server? certain function of preg_replace only work since 5.1.0. like count parameter.
     
    webrickco, Oct 17, 2008 IP
  3. fireworking

    fireworking Peon

    Messages:
    460
    Likes Received:
    10
    Best Answers:
    0
    Trophy Points:
    0
    #3
    phpinfo then go to config.inc.php
     
    fireworking, Oct 17, 2008 IP
  4. computerzworld

    computerzworld Active Member

    Messages:
    214
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    58
    #4
    My test server's PHP version is 5.1.6 and for the live server it is 5.2.6 does it make any difference? and where this config.inc.php file is located and what changes i require to make in order to make it run....
     
    computerzworld, Oct 17, 2008 IP
  5. computerzworld

    computerzworld Active Member

    Messages:
    214
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    58
    #5
    problem solved :) there is no need for any extension in order to run preg_replace().
    Actually , It was a small coding mistake that got solved;)
     
    computerzworld, Oct 17, 2008 IP