Re: Whats more efficient? ( echo " "; or <?php echo ?> )

From: Date: Wed, 22 Oct 2003 02:34:16 +0000
Subject: Re: Whats more efficient? ( echo " "; or <?php echo ?> )
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-167045@lists.php.net to get a copy of this message
which is more efficient to do: 1. <option value="1"<?php if($th_order==1){echo " SELECTED"; } ?>>Something1</option> <option value="2"<?php if($th_order==2){echo " SELECTED"; } ?>>Something2</option> (or) 2. instead of having the <?php and ?> mixed in the HTML is it better to echo/print the whole lines?
Really just a matter of personal preference. If I have a mostly PHP page, I would use echo to print out chunks of HTML. If I have a mostly HTML page (or section of a page), I would use separate <?php ?> sections within it. I doubt you'd notice any performance difference between the two so use whichever is easier for you to code. Larry

« previous php.general (#167045) next »