Archive for the ‘Basic Programming’ Category
Tuesday, August 10th, 2010
Next in line is array_diff_uassoc() function which compares two or more arrays while checking for differences before comparing the keys with a user-defined location. It then returns an array withthe keys and values from the first array(to which all the values were comapred against) it the function allows it. Syntax ...
Posted in Basic Programming, Sample Code | No Comments »
Saturday, July 10th, 2010
The first function, array_diff() is used for comparing several tables or arrays which gives an array with the keys and values from the first array if the value is not available in the other arrays. Syntax is as follows : array_diff(array1,array2,array3......), where array 1 is the table to which all ...
Posted in Basic Programming, Sample Code | No Comments »
Thursday, June 10th, 2010
The array_count_values() function returns an array which contains the keys of the original array's value and the value is the number of occurences. A sample of it's use is shown below:
Which would give us an output of : Array ( [Mouse]=> 1 [Cat]=> 2 [Dog]=> 1 )
The next functions are ...
Posted in Basic Programming, Sample Code | No Comments »
Monday, May 10th, 2010
As with all programming languages PHP has different variable types such as numeric, character, string and Boolean types. Boolean variables in PHP always return either true or false, integers are whole numbers, floating points are decimal or scientifically notated and strings are a chain of characters. Sounds familiar, well they ...
Posted in Basic Programming | No Comments »
Saturday, April 10th, 2010
The major notable difference with PHP against other languages with regards to variables is that PHP is more "intelligent". In C for example, variables have to be explicitly defined as either numeric or alpha-numeric and can only be used to store that defined specific form of data. PHP like all ...
Posted in Basic Programming | No Comments »
Wednesday, March 10th, 2010
Now, to make you a better programmer we all know the value of comments. This allows you to understand the code that you have written defining and given meaning to operations as you build them up. You start with the terminators used by PHP and end with them as well. ...
Posted in Basic Programming, Sample Code | No Comments »
Wednesday, February 10th, 2010
As you might have seen, all of the PHP statement ends with �;� which would be somewhat similar to Perl. The valid HTML code that was handed back to the server was :
Who are You?
My name is MacGyver.
More in the coming posts when we dig deeper as we widen our ...
Posted in Basic Programming, Sample Code | No Comments »
Sunday, January 10th, 2010
Now that you have installed the necessary web server software and tested that it works (which is included in the manual) we can now get to know the basics of PHP. For our guide we will be using HTTP combined with PHP, this allows PHP code to be embedded ...
Posted in Basic Programming, Sample Code | No Comments »
Friday, December 11th, 2009
The array_chunk() function on the on the other hand as the name implies, divides an array into chunks or several tables from the source table. The syntax goes something like array_chunk(array,size,preserve_key), wherein the array is the table that would be divided, the size is the number of elements which the ...
Posted in Basic Programming, Sample Code | No Comments »
Friday, November 6th, 2009
This form of array declaration allows one to change the case from uppercase to lowercase and vice versa. The syntax goes as follows:
array_change_key_case(array,case)
The array part, specifies which table or array to use and is a required field which is not the case with the key which is automatically assigned a ...
Posted in Basic Programming, Sample Code | No Comments »