PDA

View Full Version : Shortest Question Ever #1


pyrexyn
10-11-2003, 07:50 PM
Is
$blah = trim($blah)
and
trim($blah)
the same?

As in, do they both store the result to $blah? (Only Yes or No required)

n8thegreat
10-11-2003, 08:58 PM
i dont think so, i think if you wanted to keep the trim you would have to do $blah = trim($blah); but i dont really know for sure

pyrexyn
10-11-2003, 09:01 PM
thanks, anyone have a more definate answer?

i don't mean just the trim function - for any function that has a similar syntax...

n8thegreat
10-11-2003, 09:19 PM
why dont you try it :P

if thats the case then im almost positive that no they arent the same. because if you use it in an if statement like if(trim($blah) == "") it does not save the trim part to the variable

scoutt
10-11-2003, 10:18 PM
do they both store the result to $blah?

how can it if you didn't assign it to anything?

the answer is

NO

pyrexyn
10-12-2003, 12:40 AM
lol i can only test php on my server, and my server was down so i couldn't "try it"

i write code on paper when i can't do it online so needed that info to keep going lol

thanks scoutt

scoutt
10-12-2003, 12:44 AM
no you can test it on your machine. you need php and apache server and you can run php locally.

pyrexyn
10-12-2003, 12:49 AM
my computer is really crappy. it can't even open outlook express without getting an error. sometimes windows won't even load properly and i have to end task for explorer lol - stupid windows ME.

i've tried getting the PHP stuff, and it worked for a bit, and then it went berserk.

Josh
10-14-2003, 03:17 PM
back everything up and reformat

pyrexyn
10-14-2003, 09:59 PM
wayyy too lazy to do that lol.

i'll get a new computer soon.