Categories:
.NET (961)
C (387)
C++ (185)
CSS (84)
DBA (8)
General (31)
HTML (48)
Java (641)
JavaScript (220)
JSP (109)
JUnit (31)
MySQL (297)
Networking (10)
Oracle (562)
Perl (48)
Perl (9)
PHP (259)
PL/SQL (140)
RSS (51)
Software QA (28)
SQL Server (5)
Struts (20)
Unix (2)
Windows (3)
XHTML (199)
XML (59)
Other Resources:
Can You Pass an Array into a Function
Can You Pass an Array into a Function? - PHP Script Tips - Creating Your Own Functions
✍: FYIcenter.com
You can pass an array into a function in the same as a normal variable. No special syntax needed. Here is a PHP script on how to pass an array to a function:
<?php function average($array) { $sum = array_sum($array); $count = count($array); return $sum/$count; } $numbers = array(5, 7, 6, 2, 1, 3, 4, 2); print("Average: ".average($numbers)."\n"); ?>
This script will print:
Average: 3.75
2007-04-24, 4609👍, 0💬
Popular Posts:
How To List All Values of Submitted Fields? - PHP Script Tips - Processing Web Forms If you want lis...
How To View All Columns in an Existing Table? - Oracle DBA FAQ - Managing Oracle Database Tables If ...
Can two catch blocks be executed? No, once the proper catch section is executed the control goes fin...
What is difference between SITP and UTP in testing ? UTP (Unit Test Plan) are done at smallest unit ...
What is a measure in OLAP ? Measures are the key performance indicator that you want to evaluate. To...