Reputation: 3695
I have a form that updates a user's info. How can I tell the form to NOT update certain fields when left blank?
if(trim($email) == '') { /* don't update */ }
Upvotes: 0
Views: 2068
Reputation: 13517
This is better:
if ( empty( trim( $email ) ) )
{
// do not update
}
else
{
// update
...
}
Upvotes: 2