$products = [ ['name' => 'iPhone', 'category' => 'electronics'], ['name' => 'T-shirt', 'category' => 'clothing'], ['name' => 'Book', 'category' => 'books'], ]; $category = 'electronics'; // filter products by category $filteredProducts = array_filter($products, function($product) use ($category) { return $product['category'] == $category; }); // display filtered products foreach ($filteredProducts as $product) { echo $product['name'] . 'In this example, we have an array of products with their respective categories. We then use the array_filter function to select only the products with the desired category, and display them using a foreach loop. There are many libraries and packages available for PHP that provide more advanced category find functionality, including database integration, caching, and more. Some popular examples include Laravel's Eloquent ORM, Yii's Active Record, and Doctrine ORM.
'; }