Categories:
.NET (357)
C (330)
C++ (183)
CSS (84)
DBA (2)
General (7)
HTML (4)
Java (574)
JavaScript (106)
JSP (66)
Oracle (114)
Perl (46)
Perl (1)
PHP (1)
PL/SQL (1)
RSS (51)
Software QA (13)
SQL Server (1)
Windows (1)
XHTML (173)
Other Resources:
How To Get All the Values Out of an Array
How To Get All the Values Out of an Array? - PHP Script Tips - PHP Built-in Functions for Arrays
✍: FYIcenter.com
Function array_values() returns a new array that contains all the keys of a given array. Here is a PHP script on how to use array_values():
<?php
$mixed = array();
$mixed["Zero"] = "PHP";
$mixed[1] = "Perl";
$mixed["Two"] = "Java";
$mixed["3"] = "C+";
$mixed[""] = "Basic";
$mixed[] = "Pascal";
$mixed[] = "FORTRAN";
$values = array_values($mixed);
print("Values of the input array:\n");
print_r($values);
?>
This script will print:
Values of the input array:
Array
(
[0] => PHP
[1] => Perl
[2] => Java
[3] => C+
[4] => Basic
[5] => Pascal
[6] => FORTRAN
)
2007-04-21, 5167👍, 0💬
Popular Posts:
What is CodeDom? “CodeDom” is an object model which represents actually a source code. It is designe...
How can I implement a variable field width with printf? That is, instead of something like %8d, I wa...
What Happens If One Row Has Missing Columns? - XHTML 1.0 Tutorials - Understanding Tables and Table ...
How do we create DCOM object in VB6? Using the CreateObject method you can create a DCOM object. You...
How To Use "IF" Statements on Multiple Conditions? - Oracle DBA FAQ - Understanding PL/SQL Language ...