Could anyone tell me how to check if a variable has been assigned a value. I want to make it where my code checks to see if they filled out a text field or not.
THanks for your help
John
Checking if a variable has been set?
Moderator: General Moderators
Code: Select all
empty();
isset();-
designerman
- Forum Newbie
- Posts: 4
- Joined: Mon Jul 09, 2007 5:47 am
- Gente
- Forum Contributor
- Posts: 252
- Joined: Wed Jun 13, 2007 9:43 am
- Location: Ukraine, Kharkov
- Contact:
Please be careful with you posts. Zoxive posted the valid answer. Your proposition isn't really good.designerman wrote:you can also check for if($foo == ""){ // contained nothing } becuase you may set a var in your code before and check for this
You can clear the contents of a var by using the empty function