Hello
how to check equals arrays?
for ex:
$t1 = array("G", "G", "G", "G", "G");
is true
and
$t2 = array("G1", "G", "G", "G", "G");
is false
thank you
2 replies to this topic
#1
Posted 19 May 2011 - 10:21 PM
|
|
|
#2
Posted 19 May 2011 - 11:06 PM
Feel free to look at the array functions available:
PHP: Array Functions - Manual
You could utilize array_diff of which will return an array (either with zero or more elements) which can determine if there is a unique value in one of the arrays. You could certainly count() the result to check for the amount of different elements on this simple array.
PHP: Array Functions - Manual
You could utilize array_diff of which will return an array (either with zero or more elements) which can determine if there is a unique value in one of the arrays. You could certainly count() the result to check for the amount of different elements on this simple array.
Be sure to read the updated FAQ! || Health is achieved through the same 10,000 steps.
If a suggested code/method fails, informing us is less important than telling us why or what errors occurred.
If a suggested code/method fails, informing us is less important than telling us why or what errors occurred.
#3
Posted 23 May 2011 - 11:46 PM
You could also look at array_unique() function
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users


Sign In
Create Account


Back to top









