Reputation: 171
can you please clarify my query.. in one part of coding, i would like to initialize or remove the values of POST variables so that the below condition turns TRUE
(!isset(($_POST['abc'])
I did try ($_POST['abc']='') but didnt work as empty value was assigned and !isset condition failed..
hope am clear.. please guide me thro
thanks,
Samuel Mathews.
Upvotes: 1
Views: 2056
Reputation: 32532
you can use unset($_POST['abc'])
Though generally speaking, best practice is to treat $_POST
as read-only. You should instead copy $_POST
to a diff var for manipulation.
Upvotes: 1
Reputation: 799
You can either unset($_POST['abc'])
, or check empty($_POST['abc'])
instead of isset()
.
Upvotes: 2