Re: [PHP] Parsing Variables Inside a String

2007-08-15 Thread Jim Lucas
[EMAIL PROTECTED] 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! Thanks! One thing to add to what everybody else is saying,

Re: [PHP] Parsing Variables Inside a String

2007-08-15 Thread heavyccasey
anchanworld.com/ > http://webdirectory.sanchanworld.com - Submit your website URL > http://webhosting.sanchanworld.com - Choose your best web hosting plan > > -Original Message- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] > Sent: Wednesday, August 15, 2007 12:41 PM

RE: [PHP] Parsing Variables Inside a String

2007-08-15 Thread Sanjeev N
ng plan -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 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 <[

RE: [PHP] Parsing Variables Inside a String

2007-08-15 Thread Sanjeev N
iable.. 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: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Wednesday, August 15, 2007 12:21

Re: [PHP] Parsing Variables Inside a String

2007-08-15 Thread heavyccasey
I need to get the variable names from a database. On 8/15/07, Chris <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] 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$

Re: [PHP] Parsing Variables Inside a String

2007-08-15 Thread Chris
[EMAIL PROTECTED] 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 sh

[PHP] Parsing Variables Inside a String

2007-08-14 Thread heavyccasey
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:/

Re: [PHP] Parsing variables within string variables

2006-04-07 Thread David Clough
Dear Paul, this is exactly the problem: the string including the dollar sign comes from the database. The problem I have is that the echo statement parses the $bar reference, but not the $foo reference within it. So echo $bar generates Hello $foo which is better than $bar but d

Re: [PHP] Parsing variables within string variables

2006-04-07 Thread Dave Goodchild
Use double quotes/ On 07/04/06, David Clough <[EMAIL PROTECTED]> wrote: > > I've been bashing my head against the wall on this, and would be glad of > help to stop. > > I have a variable containing a string that contains the names of > variables, and want to output the variable with the variables

Re: [PHP] Parsing variables within string variables

2006-04-07 Thread Paul Novitski
I wrote: You need to EVALUATE the string coming from the database: Assuming that $sDataField contains the string 'Hello $foo': $foo = "cat"; $sText = eval($sDataField); RESULT: $sText = "Hello cat" http://php.net/eval I was assuming that you meant that the string "Hello $fo

Re: [PHP] Parsing variables within string variables

2006-04-07 Thread Paul Novitski
At 09:37 AM 4/7/2006, David Clough wrote: I have a variable containing a string that contains the names of variables, and want to output the variable with the variables it contains evaluated. E.g. $foo contains 'cat' $bar contains 'Hello $foo' and I want to output $bar as Hello cat T

RE: [PHP] Parsing variables within string variables

2006-04-07 Thread Chrome
vid Clough; php-general@lists.php.net Subject: RE: [PHP] Parsing variables within string variables [snip] I have a variable containing a string that contains the names of variables, and want to output the variable with the variables it contains evaluated. E.g. $foo contains 'cat'

RE: [PHP] Parsing variables within string variables

2006-04-07 Thread Jay Blanchard
[snip] I have a variable containing a string that contains the names of variables, and want to output the variable with the variables it contains evaluated. E.g. $foo contains 'cat' $bar contains 'Hello $foo' and I want to output $bar as Hello cat The problem is that if I use

RE: [PHP] Parsing variables within string variables

2006-04-07 Thread Kevin Davies - Bonhurst Consulting
David, Is this what you're looking for? $bar = 'Hello '.$bar HTH, Kevin -Original Message- From: David Clough [mailto:[EMAIL PROTECTED] Sent: 07 April 2006 17:37 To: php-general@lists.php.net Subject: [PHP] Parsing variables within string variables I've been bas

Re: [PHP] parsing variables inside a variable?

2004-01-31 Thread jimbo
Yes when I checked out the manual page for eval() it did occur to me that it did open up significant potential for abuse. As it happens I am passing user supplied values into these variables, but I validate all my input anyway to prevent people from modifying my queries etc.. I have observed that

RE: [PHP] parsing variables inside a variable?

2004-01-30 Thread Ford, Mike [LSS]
On 30 January 2004 12:35, jimbo wrote: > Great - thanks v. much Mike. I don't know why there was no mention of > eval() in the section of the manual on Variable Parsing. Possibly because they didn't want to get into the security issues involved. It sounds like you're ok there, as you only intend

Re: [PHP] parsing variables inside a variable?

2004-01-30 Thread jimbo
Great - thanks v. much Mike. I don't know why there was no mention of eval() in the section of the manual on Variable Parsing. James -- www.jholt.co.uk : affordable business website solutions www.htpshareware.com : software for the disorga

RE: [PHP] parsing variables inside a variable?

2004-01-30 Thread Ford, Mike [LSS]
On 29 January 2004 14:56, jimbo wrote: > Hi, > > I have a query regarding variable parsing. > > I have some text in a MySQL database in which I have included some > variable names. Eg (but w/o quotes): "thankyou $name for registering > on our web site". > > I query and use mysql_fetch_array to

[PHP] parsing variables inside a variable?

2004-01-29 Thread jimbo
Hi, I have a query regarding variable parsing. I have some text in a MySQL database in which I have included some variable names. Eg (but w/o quotes): "thankyou $name for registering on our web site". I query and use mysql_fetch_array to get the data into an associative array. I then build a st

Re: [PHP] Parsing Variables

2003-07-30 Thread Curt Zirzow
* Thus wrote Jason Williard ([EMAIL PROTECTED]): > I would like to create a script that reads a file name that follows a > specific format and have it parsed into 2 variables. The format is as > follows: > > cli_info-ACCOUNT-USERNAME.dat > > The two variables that I would like to get out of this

[PHP] Parsing Variables

2003-07-30 Thread Jason Williard
I would like to create a script that reads a file name that follows a specific format and have it parsed into 2 variables. The format is as follows: cli_info-ACCOUNT-USERNAME.dat The two variables that I would like to get out of this are the ACCOUNT and USERNAME. The rest of the information can

RE: [PHP] parsing variables through webpages

2002-10-07 Thread David Freeman
> I send hidden variables from a form to a php. In the php > I have the following code to convert the global vars sent: > > If (isset($_GET['foo'])) > $foo = $_GET['foo'] > else > $foo = 0; > > But this only works using the "GET" method! If you're sending the

Re: [PHP] parsing variables through webpages

2002-10-07 Thread Marco Tabini
You can use $_POST in a similar fashion to retrieve values from form that have been posted with the POST method. Also, you can use $_REQUEST to catch both at the same time. In this case, you may have a problem if the same variable is passed through both GET and POST, in that one will override th

[PHP] parsing variables through webpages

2002-10-07 Thread Edgard Berendsen
I send hidden variables from a form to a php. In the php I have the following code to convert the global vars sent: If (isset($_GET['foo'])) $foo = $_GET['foo'] else $foo = 0; But this only works using the "GET" method! Thanks for your answer. -- PHP General Mailing

Re: [PHP] parsing variables

2001-05-17 Thread John Monfort
*oops!* Sorry about the double ampersands... newpage.php?variable1=value1&variable2=value2... __John Monfort_ _+---+_ P E P I E D E S I G N S www.pepiedesigns.com "The world is waiting, are you ready?" -+_

Re: [PHP] parsing variables

2001-05-17 Thread John Monfort
Sending variables in url: newpage.php?variable1=value&&variable2=value2&&variable3=value __John Monfort_ _+---+_ P E P I E D E S I G N S www.pepiedesigns.com "The world is waiting, are you ready?" -+_

RE: [PHP] parsing variables

2001-05-17 Thread Maxim Maletsky
rsday, May 17, 2001 7:10 PM To: Php (E-mail) Subject: [PHP] parsing variables How exactly is it that you parse variables from one page to another without using a form. I have heard you can do it by using the URL? Taz -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [

[PHP] parsing variables

2001-05-17 Thread Tarrant Costelloe
How exactly is it that you parse variables from one page to another without using a form. I have heard you can do it by using the URL? Taz -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact