code:
<?php foreach($posts as $post) {
echo $post['name']
};
?>
Result : 100 value I want to print 10 values only How that?
code:
<?php foreach($posts as $post) {
echo $post['name']
};
?>
Result : 100 value I want to print 10 values only How that?
Try like this
foreach($posts as $key => $post) {
echo $post['name'];
//It will execute only ten times
if($key == 9){
break;
}
}