do something on first array in for each code example
Example 1: if first php
$x = 1;
$length = count($data);
foreach($data as $value){
echo"
<button class='btn";
if($x === 1){
echo " first";
}
else if($x === $length){
echo " last";
}
$x++;
echo"
'>$value->services_name</button>
";
}
Example 2: @foreach 1 numper
$i = 0;
foreach ( $signatures as $signature ) {
if($i==10){
break;
}
echo 'Signature ID: ' . $signature . $i;
$i++;
}