If you go back to C languages, strings are stored as an array of characters. So if you had
$var = "ABCDEFG";
You could refer to it as the var $var or you could look at it from an array whereas $var[0] would be A, $var[1] would be B. Look at my example below:
<?php
function calendar($tele_input)
{
//return $tele_input[0];
for($i=0;$i<strlen($tele_input);$i++) {
print($tele_input[$i] . "\n");
}
}
echo calendar("ABCDEFGHIJK"); // Should return entire string
?>
it would output
imac-g5:~/PHP tc$ php test.php
A
B
C
D
E
F
G
H
I
J
K
Now to make the code you wrote work as is, you need to change your echo line to:
echo calendar(array("ABCDEFGHIJK")); // Should return entire string
As now $tele_input would be an array where item [0] in the array would be your string ABCDEFGHIJK.
Hope that explains it all to you.