Home >Backend Development >PHP Tutorial > 问一个Js的语法,在PHP该怎样表示?解决方法

问一个Js的语法,在PHP该怎样表示?解决方法

WBOY
WBOYOriginal
2016-06-13 13:42:20707browse

问一个Js的语法,在PHP该怎样表示?
Javascript:

JScript code
<!--

Code highlighting produced by Actipro CodeHighlighter (freeware)
http://www.CodeHighlighter.com/

-->
var a = 'a';
var b = null;
alert(a||b);
//这会输出a的变量值,,想问一下php应该怎么表示?


PHP code
<!--

Code highlighting produced by Actipro CodeHighlighter (freeware)
http://www.CodeHighlighter.com/

-->
$a = 'A';
$b = null;
echo $a || $b;
//这样只会输出1或0,,
//我以前记得在哪个Oauth的开发文档上看过...但我现在忘记了...
//不知道有能人能告诉一下本人..Thanks



------解决方案--------------------
$a = 'A';
$b = null;
$c = $a or $c = $b;
echo $c;
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn