So just to better myself I'm wondering which method is better for setting a variable:
Code: http://pastie.org/private/jkw9dxplv0ixovvc0omq
Method 1: Set the end variable in the if statement
-OR-
Method 2: Set a default variable and only change it's value if needed.
I hope this makes sense.
Thank in advance!
<?php
$value = 10;
$x = 'no';
if($value == 10){
$x = 'yes';
}
?>
Method two.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With