Simple question I cant seem to find the answer for. $path = "/$row-title/$cat_title.html"; PHP: I want to have the forward slashes in the variable but this way or any way I have tried wont let me. End result of variable would be something like "/business/internet.html" Thanks
$path = "/" . $row-title . "/" . $cat_title . ".html"; PHP: Try that. EDIT you damn clown, I need that green!
Well I will give you a chance too. This is what the end result is if I use that previous example with "two words" for $cat_title /Business/Web%20Design.html Now how can I replace that %20 with a - or just get rid of it all together. Right now my $path would = /Business/Web%20Design.html
Thanks, worked like a charm. Wonder if I can just keep posting questions in this thread and get my first ever script done for me.
i think your calculators broken, 2 minutes for you, 16 for me.. edit: i was thinking of pulling an all nighter, just reread what you said and realized i need some sleep! I think the reason my code is slower is that the category needs time to for you to get away before the category explodes. Then it needs to put all the little pieces back together again.
The code in the first post works for me. If you are having problems it's most likely because you used a minus symbol rather than underscore in $row_title. I suspect that was a typo. For more complex variable access within double-quoted string literals you can surround them with braces, e.g. $path = "/{$row_title}/{$cat_title}.html"; Code (PHP): Note that in klown (post 2) and T0PS3O's (post 3) examples you should use single quoted string literals as they are slightly faster when variable embedding is not required.
I once saw a Digg article where this was debunked, or at least devalued. They did something like change all of the doubles to singles in 20K lines of code and the speed improvement wasn't noticable. I guess it comes down to habit and a willingness to change it, but I wouldn't do it for speed.
Yeah - slightly being a trivial amount in most circumstances. Like everything it depends on how performance-intensive the particular section of code is, of course.