purencool Posted June 5, 2011 Share Posted June 5, 2011 hi phpfreaks, I have an array the returns from pdo look up. The issue is when it come back with an empty array. In the example below if the result comes back with an empty array I believe(but could be wrong) that in_array should check to see if the array is empty and if it is not access the if statement is not granted do I have this right? if (!in_array("", $access)){ $_SESSION['details']['name'] = $user; $_SESSION['details']['access']= $access[0]['Admin_Level']; $return = "Welcome user (access object)"; } else { $return ="there is no such user"; } Quote Link to comment https://forums.phpfreaks.com/topic/238497-test-contents-of-an-array/ Share on other sites More sharing options...
Pikachu2000 Posted June 5, 2011 Share Posted June 5, 2011 empty Quote Link to comment https://forums.phpfreaks.com/topic/238497-test-contents-of-an-array/#findComment-1225572 Share on other sites More sharing options...
purencool Posted June 5, 2011 Author Share Posted June 5, 2011 sorry for the late reply I was look at your XXS post on your site clever how it goes to google first. . The artical was amazing I have started using # as of two minutes ago tested and working. People should read this for a secure form on your web site. I never new!!!!!!!!!!!! Oh yes and the response worked as well lol Quote Link to comment https://forums.phpfreaks.com/topic/238497-test-contents-of-an-array/#findComment-1225582 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.