Friday, August 28, 2015

How to reverse a string

//how to reverse a string
$string = "FTFL!!";
$count = strlen($string) - 1;;
for($i = $count; $i >= 0; $i--){
  echo $string[$i];
}

No comments:

Post a Comment

css snippet for blogger code highlighting

code, .code {     display: block;     background: beige;     padding: 10px;     margin: 8px 15px; }