Please help me with 1 line of code

Discussion in 'PHP' started by nasi, Oct 26, 2011.

  1. #1
    HI DP's,

    I want to change 1 line of code in my script,but I'm not PHP coder so don't know how:
    $html = preg_replace('#<a[^>]*class="add-review"[^>]*>.*?</a>#is', '', $html);

    The line above replace links but i want to replace specific text,which is not <a but :
    </div><div class="business-info">

    Please help me to replace the business info part.

    Regards in advance

    Nasi
     
    nasi, Oct 26, 2011 IP
  2. mfscripts

    mfscripts Banned

    Messages:
    319
    Likes Received:
    4
    Best Answers:
    8
    Trophy Points:
    90
    Digital Goods:
    3
    #2
    If it's just specific text you want to replace, try this:

    $html = str_replace('</div><div class="business-info">', '[REPLACEMENT_TEXT]', $html);
     
    mfscripts, Oct 28, 2011 IP