You are not logged in.
Login
or
Register
.
JsPHP: a JavaScript library providing the PHP API
Home
Register
Demo
Categories
Functions
Contributors
Download
Links
Comments
FAQ
Contact
View
Edit
Benchmark
Revisions
Developers
Dependencies
Talk
Links
array_values:
Edit: array_values
Function:
array_values
View array_values
Edit array_values
Edit code
Edit tests
Edit benchmark
View latest code
Edit latest code
Benchmark array_values
Comment on array_values
Comment on the latest code
View revisions
View versions
View contributors
View dependencies
View comments
View links
Download production code
Download development code
View the PHP docs
View phpjs.org
View phpjs.org raw code
Description:
Return just the values from the input array.
Edit function
Code
:
function array_values (input) { // http://jsphp.co/jsphp/fn/view/array_values // + original by: Kevin van Zonneveld (http://kevin.vanzonneveld.net) // + improved by: Brett Zamir (http://brett-zamir.me) // * example 1: array_values( {firstname: 'Kevin', surname: 'van Zonneveld'} ); // * returns 1: {0: 'Kevin', 1: 'van Zonneveld'} var tmp_arr = [], key = ''; if (input && typeof input === 'object' && input.change_key_case) { // Duck-type check for our own array()-created PHPJS_Array return input.values(); } for (key in input) { tmp_arr[tmp_arr.length] = input[key]; } return tmp_arr; }
You have to be logged in to edit functions.
Edit tests
Code
:
You have to be logged in to edit tests.
Edit benchmark
Code
:
You have to be logged in to edit benchmarks.
[
top
]
Comments
There are no comments yet, be the first!
Please
Login
or
Register
to post comments.