PDA

View Full Version : what one



aidant
14-04-2011, 07:29 PM
would you rather do
<?php
if ($var==$var){echo $var;}
?>

or
<?php
($var==$var)?echo $var;
?>

Johno
14-04-2011, 09:48 PM
I tend to always use the traditional if statement rather than using the ternary operator, not sure why - just always done it like that.

iLogan
14-04-2011, 11:14 PM
I would use the former.

zCode
15-04-2011, 12:50 AM
Hm, try this!

<?php
$var=67787;
echo $var;
?>

-------------------------------------------------+

I might not be giving you what you're looking for, because your script kinda confused me a bit. Lol! But if you're just trying to echo a variable, I've projected the right formula for you! http://w3schools.com

Dentafrice
15-04-2011, 03:20 AM
Hm, try this!

<?php
$var=67787;
echo $var;
?>

-------------------------------------------------+

I might not be giving you what you're looking for, because your script kinda confused me a bit. Lol! But if you're just trying to echo a variable, I've projected the right formula for you! http://w3schools.com

Was this a joke? LOL.

aidant
15-04-2011, 01:17 PM
woa.. urm i dont think that anything related..

triston220
15-04-2011, 07:38 PM
<?PHP
if ($var == '1'){

}else{

}
?>

caaraa
17-04-2011, 11:47 AM
GOOD LUCK!
http://www.primeaffiliate.com/track/images/18.games.jpghttp://farm1.static.flickr.com/152/buddyicons/[email protected]

Edited by Illuminite (Trialist Forum Moderator):
Please do not post pointlessly.

Dentafrice
18-04-2011, 02:08 PM
That's stupid. 1 is an integer not a string.

Agnostic Bear
19-04-2011, 12:10 AM
Unless it's a string in which case it is a string!

Want to hide these adverts? Register an account for free!