Jump to content

Cutting an array in half


smith.james0

Recommended Posts

Then I'll learn you how :)

Ok... you have the [url=http://php.net/manual]manual[/url]. Then you ask yourself: What is my problem? And in this case the answer would be: I need to do something with arrays. Then you click on [url=http://php.net/ref.array]Array Functions[/url]. Now you read the function list. And you'll see two functions that might be useful: [quote=PHP Manual][url=http://php.net/array_slice]array_slice[/url] -- Extract a slice of the array
[url=http://php.net/array_splice]array_splice[/url] -- Remove a portion of the array and replace it with something else[/quote]
Then you go to the entry you think that solves your problem best, read the syntax and possibly examples and then you apply it to your code.

If you already know the name of the function you need help with, you just go directly to it's manual entry by typing [tt]php.net/<function name here>[/tt] in the address bar.

Always check the manual first. It's an invaluable resource ;)

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.