Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

laravel return a single dimensional array

    $catcount    = 2;
    $parents_ids = [];
    for ($i = 0; $i < $catcount; $i++) {
        $parents_ids[] = $userCategory[$i];
    }
    $subCats = Category::whereIn('parent_id', $parents_ids)->pluck('id');
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #laravel #return #single #dimensional #array
ADD COMMENT
Topic
Name
9+8 =