problem occures in if condition [closed]
I am tring to give condition, but it cant give appropriate result.
like
if($this->data['EmployeeExprienceDetail']['file_n开发者_如何转开发ame']['type'] != 'image/jpeg')
is this condition is ok or not...guide me
thanks
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 />";
精彩评论