array_sum Calculate the sum of values in an array : Array Function : Data Structure PHP Source Code
Ajax
Ajax Examples
Ajax Tutorials
Scripts and Programs
Javascript
Javascript Examples Tutorials
DHTML Tutorials
Javascript References
Scripts and Programs
HTML
HTML Tutorials
HTML References
HTML DOM 0 References
HTML DOM 2 References
CSS
CSS Tutorials
CSS References
PHP
PHP Source Code
PHP References
Scripts and Programs
C#
C# Source Code
C# Examples
PHP Source Code
»
Data Structure
»
Array Function
»
array_sum Calculate the sum of values in an array
<?php
$grades = array
(
42
,
"hello"
,
42
)
;
$total = array_sum
(
$grades
)
;
print $total;
?>
HTML code for linking to this page:
Related in same category :
array_combine
array_key_exists
array_keys
array_diff_assoc
array_flip
array_values
Using the array_unique () Function
Array array_chunk
Array shuffle
array_unshift
Using the array_intersect () Function
Using the array_diff () Function
array_merge_recursive
Using the array_merge () Function
array_rand Pick one or more random entries out of an array
array_search Searches the array for a given value and returns the corresponding key if successful
Array count value
array_reverse Return an array with elements in reverse order
array_pop Pop the element off the end of array
array_push Push one or more elements onto the end of array
array_pad Pad array to the specified length with a value
Using the array_push () Function
count() function can also be used to access certain elements in the array
The count() Function
Using_the array_shift () Function
array_splice Remove a portion of the array and replace it with something else
Using the array_slice () Function
current
end Set the internal pointer of an array to its last element
in_array: Checks if a value exists in an array
array_multisort
next Advance the internal array pointer of an array
PHP Function Reference -> Users Code Examples / Notes - > Array Function:
Useful functions and operators
Arrays
Specifying with array
Useful functions
Array do's and don'ts
Converting to array
Array Operators
Functions
User-defined functions
Function arguments
Variable functions
Internal (built-in) functions
The magic functions __sleep and __wakeup
ReflectionFunction
Functions restricted/disabled by safe mode
Function Reference
.NET Functions
Apache-specific Functions
apd_dump_function_table
override_function
rename_function
Array Functions
array_change_key_case
array_chunk
array_combine
array_count_values
array_diff_assoc
array_diff_key
array_diff_uassoc
array_diff_ukey
array_diff
array_fill_keys
array_fill
array_filter
array_flip
array_intersect_assoc
array_intersect_key
array_intersect_uassoc
array_intersect_ukey
array_intersect
array_key_exists
array_keys
array_map
array_merge_recursive
array_merge
array_multisort
array_pad
array_pop
array_product
array_push
array_rand
array_reduce
array_reverse
array_search
array_shift
array_slice
array_splice
array_sum
array_udiff_assoc
array_udiff_uassoc
array_udiff
array_uintersect_assoc
array_uintersect_uassoc
array_uintersect
array_unique
array_unshift
array_values
array_walk_recursive
array_walk
array
in_array
Aspell functions [deprecated]
BBCode Functions
BCMath Arbitrary Precision Mathematics Functions
bcompiler_write_function
bcompiler_write_functions_from_file
Bzip2 Compression Functions
Calendar Functions
CCVS API Functions [deprecated]
Class/Object Functions
call_user_method_array
Classkit Functions
ClibPDF Functions [deprecated]
Crack Functions
Character Type Functions
curl_setopt_array
Cybercash Payment Functions
Credit Mutuel CyberMUT functions
Cyrus IMAP administration Functions
Date and Time Functions
DB++ Functions
Database (dbm-style) Abstraction Layer Functions
dBase Functions
DBM Functions [deprecated]
dbx Functions
Direct IO Functions
Directory Functions
DOM Functions
DOM XML Functions
enchant Functions
Error Handling and Logging Functions
Exif Functions
Expect Functions
File Alteration Monitor Functions
Forms Data Format Functions
Fileinfo Functions
filePro Functions
Filesystem Functions
Filter Functions
filter_input_array
filter_var_array
Firebird/InterBase Functions
Firebird/Interbase Functions (PDO_FIREBIRD)
FriBiDi Functions
FrontBase Functions
fbsql_fetch_array
FTP Functions
Function Handling Functions
call_user_func_array
create_function
function_exists
get_defined_functions
register_shutdown_function
register_tick_function
unregister_tick_function
GeoIP Functions
Gettext Functions
GMP Functions
gnupg Functions
Haru PDF Functions
hash Functions
HttpQueryString::toArray
Hyperwave Functions
hw_Array2Objrec
hw_objrec2array
Hyperwave API Functions
i18n Functions
IBM Functions (PDO_IBM)
db2_fetch_array
iconv Functions
ID3 Functions
IIS Administration Functions
Image Functions
ImagickDraw::getStrokeDashArray
ImagickDraw::setStrokeDashArray
Informix Functions
Informix Functions (PDO_INFORMIX)
Ingres II Functions
ingres_fetch_array
IRC Gateway Functions
JSON Functions
LDAP Functions
libxml Functions
Lotus Notes Functions
LZF Functions
Mail Functions
Mailparse Functions
Mathematical Functions
maxdb_fetch_array
MCAL Functions
Mcrypt Encryption Functions
MCVE (Monetra) Payment Functions
Memcache Functions
Mhash Functions
Mimetype Functions
Ming functions for Flash
Miscellaneous Functions
mnoGoSearch Functions
udm_alloc_agent_array
Microsoft SQL Server Functions
mssql_fetch_array
Microsoft SQL Server and Sybase Functions (PDO_DBLIB)
Mohawk Software Session Handler Functions
msession_get_array
msession_set_array
mSQL Functions
msql_fetch_array
Multibyte String Functions
muscat Functions
MySQL Functions
mysql_fetch_array
MySQL Functions (PDO_MYSQL)
mysqli_fetch_array
Ncurses Terminal Screen Control Functions
Network Functions
Newt Functions
NSAPI-specific Functions
Object Aggregation/Composition Functions
Oracle Functions
oci_bind_array_by_name
oci_fetch_array
ODBC Functions (Unified)
odbc_fetch_array
ODBC and DB2 Functions (PDO_ODBC)
OpenSSL Functions
Oracle Functions [deprecated]
Oracle Functions (PDO_OCI)
Output Control Functions
Ovrimos SQL Functions
Parsekit Functions
Process Control Functions
Regular Expression Functions (Perl-Compatible)
PDF Functions
PDO Functions
POSIX Functions
Regular Expression Functions (POSIX Extended)
PostgreSQL Functions
pg_fetch_array
PostgreSQL Functions (PDO_PGSQL)
Printer Functions
Program Execution Functions
Pspell Functions
qtdom Functions
Rar Functions
readline_completion_function
GNU Recode Functions
RPM Header Reading Functions
runkit Functions
runkit_function_add
runkit_function_copy
runkit_function_redefine
runkit_function_remove
runkit_function_rename
SCA Functions
SDO Functions
SDO XML Data Access Service Functions
SDO Relational Data Access Service Functions
SESAM Database Functions
sesam_fetch_array
sesam_field_array
Session Handling Functions
Shared Memory Functions
SimpleXML functions
SNMP Functions
SOAP Functions
SoapClient->__getFunctions()
SoapServer->addFunction()
SoapServer->getFunctions()
Socket Functions
Standard PHP Library (SPL) Functions
ArrayIterator::current
ArrayIterator::key
ArrayIterator::next
ArrayIterator::rewind
ArrayIterator::seek
ArrayIterator::valid
ArrayObject::append
ArrayObject::__construct
ArrayObject::count
ArrayObject::getIterator
ArrayObject::offsetExists
ArrayObject::offsetGet
ArrayObject::offsetSet
ArrayObject::offsetUnset
iterator_to_array
spl_autoload_functions
SQLite Functions
sqlite_array_query
sqlite_create_function
sqlite_fetch_array
SQLite Functions (PDO_SQLITE)
PDO->sqliteCreateFunction()
Secure Shell2 Functions
Statistics Functions
Stream Functions
String Functions
Subversion Functions
Shockwave Flash Functions
Swish Functions
Sybase Functions
sybase_fetch_array
TCP Wrappers Functions
Tidy Functions
Tokenizer Functions
Unicode Functions
URL Functions
Variable Handling Functions
is_array
Verisign Payflow Pro Functions
vpopmail Functions
W32api Functions
w32api_invoke_function
w32api_register_function
WDDX Functions
win32ps Functions
win32service Functions
xattr Functions
xdiff Functions
XML Parser Functions
XML-RPC Functions
XMLReader functions
XMLWriter Functions
XSL functions
XSLTProcessor::registerPHPFunctions
XSLT Functions
YAZ Functions
YP/NIS Functions
Zip File Functions
Zlib Compression Functions
New Functions
Integer values in function parameters
New Functions
Missing functions
Functions missing due to conceptual changes
Deprecate functions and extensions
old_function
Function TRUE/FALSE return values
List of Function Aliases
PHP Source Code
Data Structure
»
Array Function
Array Element
Array Function
Array List
Array Loop
Array range
Array sort
Associative Array
Multidimensional Array
Nested Array
Stack
Chart
Class
COM and .Net (Windows)
Components
Cookie Session
Data Structure
Databases
Design Patterns
Development
Email
File Directory
Form
Functions
Graphics Image
HTML
Language Basics
Login Authentication
Math
MySQL Database
Network
String
Web Services SOAP WSDL
XML