FRIHOST FORUMS SEARCH FAQ TOS BLOGS COMPETITIONS
You are invited to Log in or Register a free Frihost Account!


Substr-like function for array





jcreus
I wonder if there's a function in PHP which acts to arrays as substr acts to strings; equivalent to Python's
Code:

name_of_array[42:54]
name_of_array[:15]

or things like that.

Help would be greatly appreciated.
jcreus
jcreus wrote:
I wonder if there's a function in PHP which acts to arrays as substr acts to strings; equivalent to Python's
Code:

name_of_array[42:54]
name_of_array[:15]

or things like that.

Help would be greatly appreciated.

I've found it anyway, it's array_slice in case anyone needs it.
Aredon
jcreus wrote:
jcreus wrote:
I wonder if there's a function in PHP which acts to arrays as substr acts to strings; equivalent to Python's
Code:

name_of_array[42:54]
name_of_array[:15]

or things like that.

Help would be greatly appreciated.

I've found it anyway, it's array_slice in case anyone needs it.


In the future have a look through http://php.net/ for php functions like this. They run a great resource over there. For example: http://us3.php.net/manual/en/ref.array.php

Glad you found what you were looking for though. Cool
Related topics
script backup database
handling the $_POST array
which Programing launguage to learn
An Easier Way To Search An Array? Need Help Please.
Problem with Member system(or template) and $_GET[id]
after installing drupal memory error
phpBB3 UCP Profile Problem
C++ Return array from function
add to an array
I want to output an img url from a random image script
counting the unique word frequencies
Randomizer
JS: get value each line in textarea and validate.
Non-letter characters in Frihost Search
Reply to topic    Frihost Forum Index -> Scripting -> Php and MySQL

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2011 Frihost, forums powered by phpBB.