$products = array( array('name' => 'Product A', 'category' => 'Category 1', 'position' => 1), array('name' => 'Product B', 'category' => 'Category 2', 'position' => 2), array('name' => 'Product C', 'category' => 'Category 3', 'position' => 3), ); foreach ($products as $product) { echo $product['name'] . ' - ' . $product['category'] . '
'; }
Product A - Category 1 Product B - Category 2 Product C - Category 3
$posts = array( array('title' => 'Post A', 'category' => 'Category 1', 'position' => 1), array('title' => 'Post B', 'category' => 'Category 2', 'position' => 2), array('title' => 'Post C', 'category' => 'Category 3', 'position' => 3), ); foreach ($posts as $post) { echo $post['title'] . ' - ' . $post['category'] . '
'; }
Post A - Category 1 Post B - Category 2 Post C - Category 3This function is not part of a specific package or library, it is a simple PHP function that can be used in any PHP project.