RE: [PHP] Parsing Variables Inside a String

From: Date: Wed, 15 Aug 2007 10:20:23 +0000
Subject: RE: [PHP] Parsing Variables Inside a String
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-260843@lists.php.net to get a copy of this message
Consider the variable name inside database is 'emp_name' and now you want to use this as $emp_name.. This variable will be stored in as follows $variable1 = $resultfromdatabase['variable1']; Then next step is store anything in this variable as follows $$variable1 = "John"; I hope this may not help you for what you want, but at least It will gives an idea for different methods.. 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:41 PM To: Chris Cc: php-general@lists.php.net Subject: Re: [PHP] Parsing Variables Inside a String I need to get the variable names from a database. On 8/15/07, Chris <dmagick@gmail.com> wrote: > heavyccasey@gmail.com wrote: > > 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! > > Well this: > > echo $good_day . $fr['iop']; > > will do what you show here. > > > What are you trying to do exactly? > > -- > Postgresql & php tutorials > http://www.designmagick.com/ > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

« previous php.general (#260843) next »