php:字符串递增
php string increase
//For string increase.
$string1 = "hello";
$string1++;
print $string1;
//For three element operator.
$a = 1;
$b = 1;
$c = isset($girl)?$a++:$b++;
print("
\$a=$a,\$b=$b,\$c=$c");
?>
第一部分测试字符串递增,如果字符串末尾字符是数字或者字母,那么字符的ASCII值加1,上例将打印出hellp。
第二部分,三元运算符,支持短路。如果表达式为真,评估第二个表达式,第三个表达式不再评估,反之,如果第一个表达式为假,那么评估第三个表达式,第二个表达式不进行评估。