Q:

Write a PHP script to split the following string

0

Write a PHP script to split the following string.

Sample string : '082307'

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

<?php
$str1= '082307'; 
echo substr(chunk_split($str1, 2, ':'), 0, -1)."\n";
?>

Sample Output:

08:23:07

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

Similar questions


need a help?


find thousands of online teachers now