Jump to content

Few Questions...


MemphiS

Recommended Posts

Just out of interest im sure this question has been asked before..

 

Difference?Speed? between print(); and echo();

 

adding () make it slower/faster instead of just going: print ""; or echo "";

 

Just interested...

 

Another question.

 

while coding.. Example:

 

<?php
$go = $_POST['the'];

if ($go==1){ ...code to excute }
?>

/* Other example */

<?php
if ($_POST['the']){ ...code to excute }
?>

 

Just interested if theres any real point to assigning the post to a variable? Save speed by not setting a variable to it?

 

Thanks ;D

Link to comment
https://forums.phpfreaks.com/topic/53979-few-questions/
Share on other sites

with $_POST/$_GET variables... you almost always want to make them more safe... so... i subscribe to this school of thought

 

<?php
$go = htmlentities($_POST['the']);

if ($go==1){ ...code to excute }
?>

 

in the long run... its really down to the programmer...what works for you... and including the ()'s on print/echo... really arnt necessary... people use em... but i dont see a point in em... just making your code harder to read :-)

Link to comment
https://forums.phpfreaks.com/topic/53979-few-questions/#findComment-266824
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.