Issue
I am creating APP for Shopify and I need the last fulfillment id of an order.
This is my code
if($value['fulfillment_status'] == 'fulfilled') {
foreach($value['fulfillments'] as $id) {
echo $id['id'].'<br>';
}
}
The output is
3549057974422
3555100033174
3557460050070
3560109277334
3560268103830
3560845475990
3561173024918
I only want to save or get the last fulfillment id value which is
3561173024918
How to do this ?
Regards
Solution
You can use end().
echo end($value['fulfillments'])["id"];
Answered By - user6731413 Answer Checked By - Mildred Charles (PHPFixing Admin)
0 Comments:
Post a Comment
Note: Only a member of this blog may post a comment.