how to take custom amount of data from foreach loop php laravel
So in Eloquent there is a take() and skip() functions works like this: $users = DB::table(‘users’)->skip(10)->take(5)->get(); But now I’m reading data from a json file: $path = storage_path() . "/app/public/userexam.json"; json_decode(file_get_contents($path), true); So after reading data, I want to use a foreach loop: foreach($json as $js){ … } But I do need to take custom… Read More how to take custom amount of data from foreach loop php laravel