| 
        php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login | 
 PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits             
             [2004-03-25 09:39 UTC] derick@php.net
  | 
    |||||||||||||||||||||||||||
            
                 
                Copyright © 2001-2025 The PHP GroupAll rights reserved.  | 
        Last updated: Tue Nov 04 00:00:01 2025 UTC | 
Description: ------------ There is a glitch, that does not allow " to be used in preg_replace, not being replaced at all. Here's what I mean: Here is a preg_replace code, the input, and output that should be received, listed below in these text boxes I filled out Reproduce code: --------------- $input=htmlentities('<size="100%">This is a code that will change font-size using <span> tags, user-friendly style.</size>'); // This is supposed to do the proper replaces $output=preg_replace('/<size="(.+)">(.+)<\/size>/iU','<span style="font-size: $1;">$1</span>',$input); Expected result: ---------------- //Now, here is what the script is supposed to output echo '<span style="font-size: 100%">This is a code that will change font-size using <span> tags, user-friendly style.</span>'; Actual result: -------------- echo '<size="100%">This is a code that will change font-size using <span< tags, user-friendly style.</span>';