Reassigning a variable [SOLVED]

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
dwessell
Forum Commoner
Posts: 62
Joined: Fri Dec 23, 2005 2:30 pm

Reassigning a variable [SOLVED]

Post 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";
}
Last edited by dwessell on Thu Jan 05, 2006 9:07 pm, edited 1 time in total.
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

Code: Select all

if($teamName == "") {
for one.. ;)
dwessell
Forum Commoner
Posts: 62
Joined: Fri Dec 23, 2005 2:30 pm

Post by dwessell »

<groan>

Gosh darn that assignment operator :-)

Thanks a ton..
Post Reply