Answers for "null coalesce operator in php (laravel)"

PHP
0

null coalesce operator in php (laravel)

public function show($name){
       $data = [
        'twitter' => 'codewithchinekwe',
        'age' => '23',
       ];
       return view('products.index', [
          'products' => $data[$name] ?? 'product ' .$name. 'doesn\'t exist'
       ]);
   }
Posted by: Guest on May-07-2022

Browse Popular Code Answers by Language