<?php $str = chunk_split("AAAAABBBBBCCCCCDDDDD", 5, '.'); var_dump($str);
Standard input is empty
string(24) "AAAAA.BBBBB.CCCCC.DDDDD."
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!