Skip to content

Tag: arrays

Match variable value to array’s index to get month

I’m trying to turn my YYYY-MM-DD string date format to a DD mon, YYYY string. I was thinking about using an array with the months and matching the month number to it’s index, but I can’t find a way to do so. Answer You just need to pass the month – 1 on your array. It should return the…