Is this kind of code safe?

From: Date: Tue, 17 Apr 2001 11:35:14 +0000
Subject: Is this kind of code safe?
Groups: php.general 
Request: Send a blank email to php-general+get-48935@lists.php.net to get a copy of this message
I was playing around with various ways of doing conditional output of text, and I tried the following. <?php $test="b"; if ($test=="a"): ?> value is a <?php else: ?> value is not a <?php endif; ?> It seems to work, ie it outputs different text depending on the value of $test. But is it safe, can I rely on this behaviour? Maybe I just missed something somewhere, but I thought I would have to use echo or print in such circumstances. It'll be nice if I was wrong. Euan Greig Technical Consultant BRANN DATA euan.greig@brann.com 01285 645997 ************************************************************************** Any opinions expressed in this email are those of the individual and not necessarily the Company. This email and any files transmitted with it, including replies and forwarded copies (which may contain alterations) subsequently transmitted from the Company, are confidential and solely for the use of the intended recipient. If you are not the intended recipient or the person responsible for delivering to the intended recipient, be advised that you have received this email in error and that any use is strictly prohibited. **************************************************************************

« previous php.general (#48935) next »