mardi 28 juin 2016

Filter an dataset with a keyword

i have an list of fonts returned from the googlefontsapi

public function filterFont() {

    $key = $this->request('key');
    $url = "http://ift.tt/29jFcxD";
    $result = json_decode(file_get_contents( $url ));
    $filterfont = array_filter($result, function($obj)
    {
        $data = $obj->font_name == $key;
        $view = view('ajax.fonts', true)->with('data', $data);
        $value=array(

                'view'=>$view
        );
        echo json_encode($value);

    });

}

now i want to filter the data according to a value how can i achieve this



from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/290zcvl
via IFTTT

Aucun commentaire:

Enregistrer un commentaire