SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Member
    Join Date
    Mar 2005
    Posts
    21
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Exclamation eregi_replace() problem? URGENT

    Code:
    <?
    $text = '<html><head><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    <title>Untitled Document</title>
    <link href="../style.css" rel="stylesheet" type="text/css">
    </head><body></body></html>';
    
    $replacement ='<style type="text/css">body { background-color: #6080AF; }</style>';
    $text = eregi_replace("\<link[^\>]#\>",$replacement,$text) ;
    
    echo $text;
    ?>
    In the above script i want to change the red line to green line. But it did not work. any help would be appriated. It's URGENT

    Thanks

  2. #2
    SitePoint Guru enygmadae's Avatar
    Join Date
    Sep 2002
    Location
    Dallas, Tx.
    Posts
    795
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hate to be silly about this, but if you know exactly what each line will be, why not just use a str_replace?
    PHP News, Views and Community: http://www.phpdeveloper.org


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •