Wednesday, February 21, 2018

Apply search on Multidimensional array in Laravel - development

Apply search on Multidimensional array in Laravel

How can I search through multiple arrays. I am making custom search functionality for datatable. How can I do that?
I am stuck how can I search and find amongst array and return the array.

$records = Array
(
    [0] => Array
        (
            [0] => 28
            [1] => http://198.58.98.34:4600/uploads/item/priority_images-1519195620005Item1.png
            [2] => Currency
            [3] => Demo1
            [4] => Hello
            [5] => 980
            [6] => 2018-02-21T06:47:15.264Z
        )

    [1] => Array
        (
            [0] => 27
            [1] => http://198.58.98.34:4600/uploads/item/1519120091372-filewinter_is_here_game_of_thrones_hd-1920x1080.jpg
            [2] => coins212
            [3] => Demo2
            [4] => Hello1
            [5] => 54564
            [6] => 2018-02-21T06:38:04.053Z
        )
);

$search = $request['search']['value'];

I tried using array_column but it was not working.
How Can I search and return the searched data.?



from Laravel Questions and Answers https://laravelquestions.com/php/apply-search-on-multidimensional-array-in-laravel/
via Lzo Media

No comments:

Post a Comment