views:

51

answers:

1

I am tring to give condition, but it cant give appropriate result.

like

if($this->data['EmployeeExprienceDetail']['file_name']['type'] != 'image/jpeg')

is this condition is ok or not...guide me

thanks

+2  A: 

Best way to check what is being passed back it to output what you want to validate against.

This will print the value to the screen

echo $this->data['EmployeeExprienceDetail']['file_name']['type']."<br />";

This will print the (if array) value to the screen

echo "<pre>".print_r($this->data['EmployeeExprienceDetail']['file_name']['type'],true)."</pre><br />";

This will print the raw value(s) to the screen

echo var_dump($this->data['EmployeeExprienceDetail']['file_name']['type']);

This will print the value to the screen, useful for displaying whitespace as you might need to trim the value before comparing it

echo "|".$this->data['EmployeeExprienceDetail']['file_name']['type']."|<br />";
Phill Pafford