Re: Tricky variable question! Impossible??

From: Date: Sat, 16 Feb 2002 17:52:40 +0000
Subject: Re: Tricky variable question! Impossible??
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-85050@lists.php.net to get a copy of this message
Well, as long as you use double quotes: " the variables will be parsed inside you statement... single quotes however mean the exact string... example: $icon = "1.jpg"; $str = "this is the image $icon"; $str2 = 'this is the image $icon'; print $str; // returns: "this is the image 1.jpg" print $str2; // returns: "this is the image $icon" Greets, Edward ----- Original Message ----- From: "Andy" <news.letters@gmx.de> To: <php-general@lists.php.net> Sent: Saturday, February 16, 2002 6:03 PM Subject: [PHP] Tricky variable question! Impossible?? > Hi guys, > > I am not sure if this is possible. Not on my knowledge, but maybe someone is > smarter than I am :-) > > I want to pass an icon to a function. Therefore I am putting all the html > into a var called icon. > Inside this html their is another variable with an array which value is set > inside the function. > > How can I pass this html thing and ensure that the variable is gonna be set? > Take a look at the code underneath. > Like that it is just printing out $picture_id[$i] > > $icon_1 = " <a > href=\"index.php?fuseaction=edit&action=delete&id=%s\" > onclick=\"return confirm('Are you sure you want to delete picture no: > $picture_id[$i]');\"> > <img src=\"../app_global/pics/delete.gif\" width=20 height=20 border=0 > alt=\"delete\"> > </a>"; > > Can anybody help on this? > > Thanx for any help > > Cheers Andy > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >

« previous php.general (#85050) next »