Write a Mysql fetchCol() query using Magento standard way without using the Model file.
To Fetches the first column of all SQL result rows as an array.
Return Type: fetchCol() always returns as an array.
3x Magento Master
Write a Mysql fetchCol() query using Magento standard way without using the Model file.
To Fetches the first column of all SQL result rows as an array.
Return Type: fetchCol() always returns as an array.
You can get last 4 digits from a credit card using Magento 2 when you worked with payment method extension or modification to payment method.
You need last four digits to show the payment credit card number in customer order’s payment details.
For Display purpose, You can show last four digits as per below code snippets,
You can set Custom formatting of Date using Magento 2 by DateTimeFactory Class.
You just need to pass the custom format of the date in the gmtDate() function as per your requirement.
Many times, you need to set the Date format to a specific format, While you are working with third-party API you need to pass the Date as the specific format from Magento, in this situation you can use below code snippet below.