function F($str){
for($i=strlen($str); $i>=0; $i--){
echo $str[$i];
}
}
$str="hello";
F($str);
but there are some errors on this line: echo $str[$i];
Error: Uninitialized string offset.
what mistake do i have?.. its interesting...
function F($str){
for($i=strlen($str); $i>=0; $i--){
echo $str[$i];
}
}
$str="hello";
F($str);
|
|
|
function F($str){
for($i=strlen($str)-1; $i>=0; $i--){
echo $str[$i];
}
}
$str="hello";
F($str);
webcodez said:
function F($str){
for($i=strlen($str)-1; $i>=0; $i--){
echo $str[$i];
}
}
$str="hello";
F($str);
0 members, 1 guests, 0 anonymous users