PHP String Exercises: Split a string
PHP String: Exercise-2 with Solution
Write a PHP script to split the following string.
Sample string : '082307'
<?php $str1= '082307'; echo substr(chunk_split($str1, 2, ':'), 0, -1)."\n"; ?>
PHP Code Editor:
Have another way to solve this solution? Contribute your code (and comments) through Disqus.
What is the difficulty level of this exercise?