Yeah, I'm really tired, How do I write a URL in PHP? $variable = (http://www.domain.com/index.php-forum-3.html) thats what my URL looks like. How do I write it so it works? I mean like adding backslashes and things.
what do you mean with "so it works"? if you want it to be clickable, you have to use proper html tags (<a href="..."></a>), if you just want to make a string with a url in it, then Acecool's solution will do fine.
Dont realy understand what your trying to do? $variable = "http://www.domain.com/index.php-forum-3.html"; echo $variable;
Avoid double quotes where possible.. In small applications it wont matter, but if you create a large application it will slow down the script quite a bit.
It won't parse variables and just spit it out (echo '$var' will spit out $var, not whats in the variable). I think amorph hit the nail on the head..
Well someone took the time you actually find this out http://spindrop.us/2007/03/03/php-double-versus-single-quotes/ It's some personal blog I ran into but it seems legit. The best part So Cody really summed up their real uses.
there really is no "best" way to do it. it's all about choice. personally i like to concatenate strings around my variables for easy location within my editor. (different color) see example. $var = "variable"; echo "this " .$var. " is being output to the screen."; PHP: vs $var = "variable"; echo "this $var is being output to the screen."; PHP:
Using single quotes forces you to do just that, and it doenst have to even look at the stuff that is not ' . here . ' which helps for HUGE applications