Preg Replace

From: Date: Tue, 06 Jan 2004 04:35:46 +0000
Subject: Preg Replace
Groups: php.general 
Request: Send a blank email to php-general+get-173822@lists.php.net to get a copy of this message
Hello, I am fighting replacing items in the following hunk of code. This code is pulled from a database, and then I want to replace items like <<name>> with the contents of a variable $name. I have tried code like: preg_replace("/\<\<\?.*?\>\>/",$name,$paypal); However it doesn't work, any suggestions are appreciated. Thanks. Here is the chunk code: <input type="hidden" name="item_name" value="<<name>>"> <input type="hidden" name="item_number" value="<<prodid>>"> <input type="hidden" name="amount" value="<<price>>"> -- Aaron Axelsen AIM: aaak2 Email: lists@frozenpc.net

« previous php.general (#173822) next »