PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
I was using array_diff to find the difference between two arrays which contained a list of files from two directories. The problem is that array_diff returns the difference but keeps the keys the same. Howd get that information from the array if the first key isn't 0, or if theres a bunch of random keys.
Set Search Time - A google chrome extension. When you search only results from the past year (or set time period) are displayed. Helps tremendously when using new technologies to avoid outdated results.
but theres only one value in that array, $thediff, and its key is two, but it will always be different, look at array_diff, so howd pull information from an array that has random key values?
$keys=array_keys($arr); // get an array starting at 0, of the keys
for ($i=0;$i<count($keys);$i++) {
// do stuff with $arr[$keys[$i]]
}
// or probably much better
foreach ($arr as $key=>$value) {
// loops over all key=>value pairs, doesn't care about order/non-zeroness
}