You need to do:
foreach($user_rating as $category) {
echo $category['description'] . "<br />";
}
Code Explanation:
Your array is like
$user_rating = array(array('percent' => ..., 'description' => ...), array(...));
This means that you have a two-dimensional array.
When you execute foreach($user_rating as $category), you iterate over the external array. This means it $categorywill be an array, namely array('percent' => ..., 'description' => ...).
, , , $description percent description.
PHP , . description , , , 0, .
$foo = 'bar';
echo $foo[0];
// echos 'b'
echo s, , :
$user_rating[0] = array('description' => 'Time Management');
$user_rating[1] = array('description' => 'Attract Clients');
$user_rating[2] = array('description' => 'Internet Marketing');
foreach($user_rating as $category) {
echo '$category: ' . $category . PHP_EOL;
foreach($category as $description) {
echo '$description: '. $description . PHP_EOL;
echo $description[description] . "<br />" .PHP_EOL;
}
}
$category: Array
$description: Time Management
T<br />
$category: Array
$description: Attract Clients
A<br />
$category: Array
$description: Internet Marketing
I<br />