Jump to content

Recommended Posts

Posted (edited)

Hi,

Let say I have a array. I want only array content that begin with XX and length less than 6.

Example: current array is:

$current_array[0] = "AB1234"

$current_array[1] = "XX11"

$current_array[2] = "XX1234567"

$current_array[3] = "XX123"

$current_array[4] = "XA1234"

New array should be:

$new_array[0] = "XX11"

$new_array[1] = "XX123"

which is begin with XX and less than 6 in length.

Any build-in function to do this?

Thanks a lot :)

Edited by michaelslamet
Posted

Hi michaelslamet,

if you use _ArrayDelete() it decreases the indexes:

$a[0] = 1
$a[1] = 2
$a[2] = 3

_ArrayDelete($a, 1)

$a[0] = 1
$a[1] = 3

If you use this in a loop you will throw an exception like array out of bounds. That's why going backwards. :)

Regards,Hannes[spoiler]If you can't convince them, confuse them![/spoiler]

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...