我不太清楚在php中声明函数,所以我会试试这个。在PHP中声明函数的正确方法?
getselection();
function getselection($selection,$price)
{
global $getprice;
switch($selection)
{
case1: case 1:
echo "You chose lemondew <br />";
$price=$getprice['lemondew'].'<br>';
echo "The price:".$price;
break;
请让我知道如果我这样做不对,我想这样做的正确方法;另外,php.net有例子,但是对于newb来说它们有点复杂,我想当我变得精通时,我会开始使用他们的文档,谢谢你不要燃烧。
请提供可能帮助我解决这个问题的链接?
为什么'$ selection'包含一个数字而不是一个字符串(例如“lemondew”)? – outis 2009-11-23 20:07:40