Jump to content

test contents of an array


purencool

Recommended Posts

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";
			}	

Link to comment
https://forums.phpfreaks.com/topic/238497-test-contents-of-an-array/
Share on other sites

sorry for the late reply I was look at your XXS post on your site clever how it goes to google first. :D. 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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.