02-25-2010, 06:45 AM
03-02-2010, 06:17 AM
hi,
An array in PHP is actually an ordered map. A map is a type that associates values to keys. This type is optimized for several different uses; it can be treated as an array, list (vector), hash table (an implementation of a map), dictionary, collection, stack, queue, and probably more. As array values can be other arrays, trees and multidimensional arrays are also possible.
..........................................................................................
Web designing Chennai | Website development company Chennai | Graphic designing companies Chennai
An array in PHP is actually an ordered map. A map is a type that associates values to keys. This type is optimized for several different uses; it can be treated as an array, list (vector), hash table (an implementation of a map), dictionary, collection, stack, queue, and probably more. As array values can be other arrays, trees and multidimensional arrays are also possible.
..........................................................................................
Web designing Chennai | Website development company Chennai | Graphic designing companies Chennai
03-04-2010, 01:38 PM
03-09-2010, 05:59 AM
Thank u so much for your sharing i got it
05-13-2010, 03:51 AM
Using the following code we can sort multidimentinal array in php
<?php
// demo array to sort
$latest_array = array(
array('news','1234567890','sdf','asdpojq'),
array('news','1234567892','uruy','xbuqiwpo'),
array('comment','1234567893','fghj','mjktyu'),
array('article','1234567891','cvmo','pjklgg'),
array('news','1234567894','qwenb','asbhtyhj'),
);
$sort_field = 3; // enter the number of field to sort
// compare function
function cmpi($a, $b)
{
global $sort_field;
return strcmp($a[$sort_field], $b[$sort_field]);
}
// do the array sorting
usort($latest_array, 'cmpi');
// demo output
echo '<pre>';
print_r($latest_array);
echo '</pre>';
?>
<?php
// demo array to sort
$latest_array = array(
array('news','1234567890','sdf','asdpojq'),
array('news','1234567892','uruy','xbuqiwpo'),
array('comment','1234567893','fghj','mjktyu'),
array('article','1234567891','cvmo','pjklgg'),
array('news','1234567894','qwenb','asbhtyhj'),
);
$sort_field = 3; // enter the number of field to sort
// compare function
function cmpi($a, $b)
{
global $sort_field;
return strcmp($a[$sort_field], $b[$sort_field]);
}
// do the array sorting
usort($latest_array, 'cmpi');
// demo output
echo '<pre>';
print_r($latest_array);
echo '</pre>';
?>
05-27-2010, 12:49 AM
PHP is a powerful tool for making dynamic and interactive Web pages.
PHP is the widely-used, free, and efficient alternative to competitors such as Microsoft's ASP.
In our PHP tutorial you will learn about PHP, and how to execute scripts on your server.
___________________________________
Whey Protein
Protein Supplements
PHP is the widely-used, free, and efficient alternative to competitors such as Microsoft's ASP.
In our PHP tutorial you will learn about PHP, and how to execute scripts on your server.
___________________________________
Whey Protein
Protein Supplements
07-08-2010, 11:41 PM
PHP identify how to evaluate two numbers or two text strings, but in a multidimensional array, each element is an array. PHP provides many utility to sort an array.
02-07-2011, 03:04 AM
Hi,
Once the PHP array can store all information (strings, numbers, objects, arrays, boolean). We use an array to save the text (string). Tables store data using a key - on a subscription basis. Key is the place we saved the text string. The value is the actual text that we want to keep.
Thanks.
Once the PHP array can store all information (strings, numbers, objects, arrays, boolean). We use an array to save the text (string). Tables store data using a key - on a subscription basis. Key is the place we saved the text string. The value is the actual text that we want to keep.
Thanks.