开发者

Php:Return a String from a function [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.

Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist

Closed 9 years ago.

Improve this question

The simple program is not returning the string,Please help.

<?php 
function returnStr开发者_JAVA技巧() {
return "fooBar";
}
$str=returnStr();
echo $str;
}
?> 


It's a parse error:

$str=returnStr();
echo $str;
}                   // WHAT IS THIS BRACKET DOING HERE?


There's a fatal error tokenizing the code due the trailing/unmatched '}' remove that and the code will work. Then spend some time thinking about why you didn't know this already


There's an error in your code. The last } is useless.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜