Read 167 times | Created 2013-02-07 04:14:26 | Updated 2013-02-07 04:14:26 | | |

 

<pre>
<?php
//strings ways...
$string='ABCDEFGHIJKLMNOPQRSTUVWXYZ';
$input='s';
$output=strstr($string,$input).strstr($string,$input,true);
$output=$output==''?strtolower(stristr($string,$input).stristr($string,$input,true)):$output;
print_r(str_split($output));
//array ways ...
$array=str_split($string);
if(array_search($input,$array)===false){
  $pos=array_search($input,array_map('strtolower',$array));
  $end=array_slice($array,$pos);
  array_splice($end,$pos,count($end),array_splice($array,0,$pos));
  $end=array_map('strtolower',$end);
}else{
  $pos=array_search($input,$array);
  $end=array_slice($array,$pos);
  array_splice($end,$pos,count($end),array_splice($array,0,$pos));
}
print_r($end);