سؤال

$DEBUG_MODE && (echo "ss");

Error Message Return:

Parse error: syntax error, unexpected T_ECHO in D:\HOSTS\web_portal\test.php on line 99

Can we do the about without using ?: or if? for echo or print_r etc.

هل كانت مفيدة؟

المحلول

it is invalid syntax. You could use print - http://bg2.php.net/print

$DEBUG_MODE && (print('test'));

http://bg2.php.net/echo

echo is not actually a function (it is a language construct), so you are not required to use parentheses with it

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top