I have a string, for example
20120201
I need to change it to
2012/02/01
obviously I need to add "/" after the 4th, 6th characters in the string.
Could someone help me do this in PHP?
Thank you.
Something like this:
$final = substr($initial,0,4).'/'.substr($initial,4,2).'/'.substr($initial,6,2)
Use substr.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With