You are here: Resolving {$var} from within a string... « PHP Programming Language « IT news, forums, messages
Resolving {$var} from within a string...

Posted by Chris Jones on 04/16/07 10:02

If i use

<?
$x = 4 ;
echo "This is the value of x: {$x}" ;
?>

i will obviously get the output
This is the value of x: 4

But when i have a string, in an SQL varchar field, such as
kra.php?EID={$eid}

I can then do $href = db_query($qry,0,"href") to get the SQL data into
$href, but when i echo $href, the $eid comes out as plain-text and
doesn't resolve to the current value of $eid.

Is it possible to force PHP to attempt to resolve any embedded $vars
within a string?
i.e. so when i output $href, i get
kra.php?EID=1

Thanks

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация