News Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

PHPMaster.com:
Array Handling Functions
October 11, 2011 @ 08:37:55

On PHPMaster.com today there's a new tutorial introducing you to the array handling features in PHP - sorting, slicing and more.

In my previous article on PHP arrays I suggested a number of things that are tables and therefore can also be expressed as arrays. In this article I'll use a pack of playing cards to explore some of the built-in array functions most often needed by PHP programmers. To highlight some of the array-handling functions PHP offers, I'll be using some components of Buraco - a game very popular in my part of the world and quite similar to Rummy.

In the example he represents a deck of cards with an array of values like "A", "03" and "13". This array is then looped to make the full set of 52 cards and shuffled to deal a "hand". Array functions put to use include array_rand, in_array and sort.

0 comments voice your opinion now!
array handling function tutorial example buraco card game


blog comments powered by Disqus

Similar Posts

Felix Geisendorfer's Blog: Include only the JS you really need

ServerGrove.com: Creating console commands with Symfony2

TotalPHP: Using an autoload function to make your life easier

PHP-Security.net: Suhosin 0.9.34-DEV Installation HowTo

Brandon Savage's Blog: Peer Review: You Have Not Because You Ask Not (Requests & Responses)


Community Events





Don't see your event here?
Let us know!


threedevsandamaybe introduction code podcast list release application api developer configure interview library series language install wordpress community laravel symfony bugfix

All content copyright, 2014 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework