My Latest Code

PHP Foreach – Query Users Tweets on Twitter

Queries twitter using specific keyword and posts most recent 100 tweets

Foreach Definition

The foreach construct provides an easy way to iterate over arrays. foreach works only on arrays and objects, and will issue an error when you try to use it on a variable with a different data type or an uninitialized variable. There are two syntaxes:

foreach (array_expression as $value)
foreach (array_expression as $key => $value)

The first form loops over the array ...

Read more →

PHP – Most Frequent Element in an Array

A program that finds the most frequent element in an array.

Program Uses PHP functions:
array_count_values, arsort, array_keys,



array_count_values() returns an array using the values of array as keys and their frequency in array as values.


arsort — Sort an array in reverse order and maintain index association
This function sorts an array such that array indices maintain their correlation with the array elements they are associated with.

This is used mainly when sorting associative arrays where the actual element order is significant.


array_keys ...

Read more →
Page 2 of 3 123