RE: [PHP] Parsing Variables Inside a String
| From: | Sanjeev N | Date: | Wed, 15 Aug 2007 10:14:02 +0000 |
| Subject: | RE: [PHP] Parsing Variables Inside a String | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-260842@lists.php.net to get a copy of this message | ||
$new = '$good_day$fr['iop']';
This will give you error...
Instead if you try in this way as follows
$new = "$good_day$fr['iop']"; or
$new = $good_day.$fr['iop'];
It will include the "They're carzy!" in the $new variable..
Warm Regards,
Sanjeev
http://www.sanchanworld.com/
http://webdirectory.sanchanworld.com - Submit
your website URL
http://webhosting.sanchanworld.com - Choose your
best web hosting plan
-----Original Message-----
From: heavyccasey@gmail.com [mailto:heavyccasey@gmail.com]
Sent: Wednesday, August 15, 2007 12:21 PM
To: php-general@lists.php.net
Subject: [PHP] Parsing Variables Inside a String
Hi, is there a function that can parse variables within a string?
For example:
$good_day = 'The';
$fr['iop'] = "y're crazy!";
$new = '$good_day$fr['iop']';
echo TheFunctionIRequest($new); // They're crazy!
Thanks!
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php