-4

I want to create bootstrap typeahead.

Here is print of my array in php.

debug($array);
//print $array =>
 array(
  4 => string 'Michelle' (length=8)
  6 => string 'Freya' (length=5)
  9 => string 'Ivana' (length=5)
  14 => string 'Stephanie' (length=9)
 );

I need to get some thing like this:

['Michelle', 'Freya', 'Ivana', 'Stephanie']
4

1 回答 1

1

Use array_values http://php.net/manual/en/function.array-values.php

$arrayWithoutCustomIndexes = array_values($array);
于 2013-03-10T16:27:39.300 回答