have trouble in a if condition


Posted on 16th Feb 2014 07:03 pm by admin

The if below is working ok, it check when indexes, name, zipcode and state are empty.
Code: <?php
if ( trim($_POST['name']) == '' && $_POST['zipcode'] =='' && $_POST['state'] ==''
?>

But when it comes to check the array types I don't know how to structure in a way that it checks weather is empty or not. I did it as below and it fails the test. How can I insert the types index array and check when is empty? empty meaning when there is not value remembering that it is an array now.

Code: if ( trim($_POST['name']) == '' && $_POST['zipcode'] =='' && $_POST['state'] =='' && isset($_POST['frmSearch']['types']) )
{ this}
else
{that}
?>

No comments posted yet

Your Answer:

Login to answer
292 Like 43 Dislike
Previous forums Next forums
Other forums

Need help PLEASE
ok i have this warning showing up

Warning: in_array() [function.in-array]: Wrong datatype for

Help Ordering Arrays
Hi, I have 3 arrays as shown below.

Code: $users = $this->get_latest_users();
$flir

Please help with SMTP Authenticated PHP Email Form
Hello, I'm creating a PHP email form, and for this particular server, I have to use SMTP Authenticat

PHP mail() with images
I'm trying to get images to send along with my HTML e-mail sent through PHP mail(). I only tried vie

Polymorphism
Was wondering if someone could explain this a little better to me. I had always assumed that it had

Mastering Regular Expressions, Third Edition, is available.
The Third Edition of Mastering Regular Expressions is available.

QuoteThis third edition is 5

a very simple php header question (sorry!)
Firstly...I do apologise if this annoys anyone....a header error

I'm do not know php &

Searching keywords from array
Hello everyone, Im just wondering if someone could help me with another issue im having. Im still le

php wont update my db
hello,

sorry for posting in mysql forum but i dont know where exactly is the problem but here

Google Map
I have done Google Map Integration for one my project. But for that we need the "latitude and l

Sign up to write
Sign up now if you have flare of writing..
Login   |   Register
Follow Us
Indyaspeak @ Facebook Indyaspeak @ Twitter Indyaspeak @ Pinterest RSS



Play Free Quiz and Win Cash