$VAR1 ['data'];
$value_data = array_search('data', $VAR1);
if ($value_data == 1){
// DATA == 1
} else {
// DATA == NOT 1
}
Main Topics
Browse All Topicshttp://pastie.org/294866
I have a form that submits to a PHP script which in turn does a shell_exec to a perl script written by someone else, which calls an API to validate the form data. The pastie is the exact response I am given when a user is not authenticated. This should be very easy for someone to figure out, but I'm on a time crunch to get this done by end of day so I need to know how to parse out each field.
Specifically, at the bottom of the response is a 'data' => '0' -- it could potentially be '1' but that shouldn't matter for these purposes. However, I want to be able to know what that value is. I also want to know what the value of the errors[{'messages'}] is *if* it exists (sometimes it won't be there, that's ok).
So in essence, I want to be able to say if (blah['data'] == '0') then do something otherwise do something else.
TIA,
Jen
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
Business Accounts
Answer for Membership
by: NerdsOfTechPosted on 2008-10-21 at 03:32:53ID: 22765837
Bless is not a PHP function - it is a PERL/CGI function
n/arrayobj ect.constr uct.php
http://us.php.net/manual/e
Try array function instead:
Select allOpen in new window