<?php
$string = 'cup';
$name = 'coffee';
$str = 'This is a $string with my $name in it.<br>';
echo $str;
eval( "\$str = \"$str\";" );
echo $str;
?>
上の例は、以下を表示します。
This is a $string with my $name in it.
This is a cup with my coffee in it.
die
Updated Mon, 14 Aug 2000
exit
Site Hosting:
Located in United States
Elements of this website are subject to copyright.
Questions about installing or using PHP should be directed to one of the mailing lists.
Only questions about the website should be directed to webmaster@php.net.