-3

I have a PHP script outputting dates like this:

03/01/2023 

Now I wish to make them output the above value as

Zero Three/Zero One/Two Zero Two Three

I have tried to create functions that return string data of that date number but did not get the exact result.

Alive to die - Anant
  • 70,531
  • 10
  • 51
  • 98

1 Answers1

0

Here you can pass your single digit date value to the function and in return it will give you the word.

You will need to modify this to some bit according to your need.

<?php
echo $key = getWord(0);
function getWord($a){
$array = array(
'0'=>'Zero', 
'1' => 'One',
'2' => 'Two',
'3' => 'Three',
'4' => 'Four',
'5' => 'Five',
'6' => 'Six',
'7' => 'Seven',
'8' => 'Eight',
'9' => 'Nine',
);

return $array[$a];

}
?>
Dharman
  • 30,962
  • 25
  • 85
  • 135
Saad
  • 105
  • 1
  • 12