Page 1 of 1

Reassigning a variable [SOLVED]

Posted: Thu Jan 05, 2006 6:48 pm
by dwessell
Hey all.. I have a variable ($teamName) and it's being passed into a function.

Before that it's being pulled from a database (VarChar)..

Inside the function, I'd like to check and see if the variable has any text assigned to it, and if not, assign some..

I've tried several variants (Inlcuding below and count_chars()).. Any suggestions?

Thanks
David



Code: Select all

if( $teamName = "" ){
	$teamName = "Team";
}

Posted: Thu Jan 05, 2006 6:51 pm
by feyd

Code: Select all

if($teamName == "") {
for one.. ;)

Posted: Thu Jan 05, 2006 9:06 pm
by dwessell
<groan>

Gosh darn that assignment operator :-)

Thanks a ton..