Reverse a string with php

后端 未结 16 1026
南笙
南笙 2020-12-03 23:42

I am trying to find a way to reverse a string, I\'ve seen alternatives but i wanted to to it this way thinking outside the box and not using anyone else\'s code as an altern

16条回答
  •  有刺的猬
    2020-12-04 00:17

    for ($i = $len-1; $i >=0;$i--)
    {
      echo $stringExp[$i];
    }
    

    Since the index starts at 0

提交回复
热议问题