-1
我是新來的PHP,我正在嘗試執行以下任務。我的任務是完成缺少的代碼。任何人都可以幫助我爲什麼函數沒有返回我希望它返回的任何建議,我可以重構我的代碼將不勝感激。正如我所提到的,我不允許改變給定的部分代碼。 作業:您的任務是完成下面的程序,以便按照示例中所示進行打印。只有一個缺失的功能需要編寫。只需在文本框中輸入缺少的功能即可。程序不完整。PHP函數參數改變給定值
<?php
// Your code here
$charstring = "first\n";
newvalue($charstring);
echo "String in the end: $charstring\n";
?>
Example output
String in the start: first
String in the end: New string
我的代碼:
function newvalue($charstring){
global $charstring;
echo "String in the start: $charstring";
return "New string";
}
這應有助於:http://stackoverflow.com/questions/12970613/variable-in-php – MonkeyZeus
我認爲它被稱爲傳遞引用...'&&charstring' – MonkeyZeus
我只是需要建議,如果我是接近任務錯誤或缺少一些東西?問先生是不對的? – user3358884