ID:               24645
 User updated by:  nek at capsule dot org
 Reported By:      nek at capsule dot org
 Status:           Open
 Bug Type:         Regexps related
 Operating System: Linux
-PHP Version:      4.3.2
+PHP Version:      4.3.1
 New Comment:

sorry, it's php 4.3.1 and not 4.3.2


Previous Comments:
------------------------------------------------------------------------

[2003-07-14 08:37:18] nek at capsule dot org

Description:
------------
Hi,

i'm trying to replace a portion of string by its strtolowered
equivalent

see reproduce code and results below : it should give
"href=javascript:comment()" but only "HREF" is lowered, not the
matching string \1



Reproduce code:
---------------
<?php
$newsaff = "<A HREF=\"JAVASCRIPT:COMMENT()\">THIS IS A TEST LINK</A>";

$newsaff =
ereg_replace("HREF=\"([^\"]+)\"",strtolower("HREF=\"\\1\""),$newsaff);

print $newsaff;
?>

Expected result:
----------------
<A href="javascript:comment()">THIS IS A TEST LINK</A>

Actual result:
--------------
<A href="JAVASCRIPT:COMMENT()">THIS IS A TEST LINK</A>


------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=24645&edit=1

Reply via email to