25. PHP Array Functions-12 | array_reverse and array_search | ATIBlog

Veröffentlicht am: 12 Dezember 2017
auf dem Kanal: ATIBlog
276
7

PHP Array functions -12 - array_reverse and array_search By: ATIBlog

array_reverse ( $array [, $preserve_keys] );
array_search($value, $array [,$strict]);


1. array_reverse()
array_reverse ( $array [, $preserve_keys] );
This function is used reverse the elements of the array.
It returns the new array with the reversed order of elements.
First parameter is the array to reverse.
Second optional parameter (PRESERVE KEYS ?) is used to take Boolean (true or false). It specifies if order of keys also has to be changed or not. By default its false.
This setting of preserve keys works for the numeric arrays only. In the associative array, the keys are already preserved (Always TRUE).


2.array_search()
array_search($value, $array [,$strict]);
This function searches inside an array for a value and return the associated key.
It returns key of the first occurrence of the value in that array.
First parameter is the value to search.
Second parameter is the array to search.
Third optional parameter specifies if the values to be checked strictly ? (check the data-types too?)


Auf dieser Seite können Sie das Online-Video 25. PHP Array Functions-12 | array_reverse and array_search | ATIBlog mit der Dauer stunde minuten sekunde in guter Qualität ansehen, das der Benutzer ATIBlog 12 Dezember 2017 hochgeladen hat, den Link mit Freunden und Bekannten teilen, dieses Video wurde auf Youtube bereits 276 Mal angesehen und es wurde von 7 den Zuschauern gefallen. Viel Spaß beim Betrachtenden Zuschauern gefallen!