I am putting the values myself yep.
Could I please ask why is it better to use
<?php echo $variableOne; ?>
instead of
<?= $rangeba4 ?>
Thanks.

I am putting the values myself yep.
Could I please ask why is it better to use
<?php echo $variableOne; ?>
instead of
<?= $rangeba4 ?>
Thanks.
Haha sorry it's not betterI'm not even sure if shorter variable names make it faster haha. I never looked into it.
Right okay, if you are putting the values in yourself and displaying them, you mayaswell not define the variables at all.
Just do
where u want the value to go. Rather than putting the variable as value and then echoing the variable. If you get me ?PHP Code:<?php
echo 'value';
?>
I understand but I am doing it for my site where I need to show the same value alot in different places. And its easier to have it as a variable because then if I change it, it changes all of them at once![]()
Ahh see I didn't know you were doing this
Yehh it won't slow it down that much. I'm trying to think whether an array would be appropriate, but it'll be too hard to grasp....
Also, since your new to php, when you want to display variables after each other you can do:
The . is ownage.PHP Code:echo $variable.$variable2.$variable3;
Thank you![]()
About the naming, it just makes it easier to name things for what they are for.
For example, $username for username, $password for password.
That's better then using:PHP Code:$site_name = "TestSite!";
$site_slogan = "We're a test site!";
Then if you want to echo them out, just do:PHP Code:$wsdfsdlj = "TestSite!";
$esskldfjs = "We're a test site!";
PHP Code:<?php echo $site_name; ?>
Want to hide these adverts? Register an account for free!