1. We have moved from vBulletin to XenForo and you are viewing the site in the middle of the move. Though the functional aspect of everything is working fine, we are still working on other changes including the new design on Xenforo.
    Dismiss Notice

preg_replace error - may be fixed

Discussion in 'PHP' started by David Ledger, Oct 21, 2010.

  1. David Ledger

    David Ledger New Member

    I have PHP 5.3.2 on my Mac, but my ISP has PHP 5.2.9

    I'm looking for confirmation of my problem in 5.2.9 so that I can try to get my ISP to upgrade.

    I see the problem on my site at the ISP, but not with interactive php use on my Mac.

    The problem:

    PHP:
    Apply
    preg_replace
    ('/^[^\%]*(\%[^\%]+\%).*/''$1'$cell)
    where $cell contains (there is a single space at beginning and end)
     
    valign="top" style="text-align:right; width:75px;"><class="f-lp">%Price%</p
    and 
    you get
    %Price%
    but if $cell contains (there is a single space at beginning and end)
     
    valign="top" style="text-align:right; width:75px;"><class="f-lp">%LineTotal%</p> </td
    then you get
    %LineTotal% </td
    (
    which has a space on the end).
    I've tried various fiddles and variants, but can't get rid of the trailing <space></td> in the second case when using my ISP's PHP.

    Please forgive the mix of code and non-code in the CODE block.

    David
     

Share This Page