SHARE
TWEET

Untitled

a guest Nov 9th, 2019 81 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2.     function printWords($text)
  3.     {
  4.         $array = str_split($text, 1);
  5.         $result = array();
  6.         for($i = 0; $i < count($array); $i++){
  7.             if($array[$i] == "A"){
  8.                 $result[$i] = $array[$i];
  9.                 unset($array[$i]);
  10.             }elseif($array[$i] == "I"){
  11.                 $result[$i] = $array[$i];
  12.                 unset($array[$i]);
  13.             }elseif($array[$i] == "U"){
  14.                 $result[$i] = $array[$i];
  15.                 unset($array[$i]);
  16.             }elseif($array[$i] == "E"){
  17.                 $result[$i] = $array[$i];
  18.                 unset($array[$i]);
  19.             }elseif($array[$i] == "O"){
  20.                 $result[$i] = $array[$i];
  21.                 unset($array[$i]);
  22.             }
  23.         }
  24.         $array = array_values($array);
  25.         $result = array_merge($result, $array);
  26.  
  27.         foreach($result as $row){
  28.             echo "<span>".$row."</span>"."<br>";
  29.         }
  30.     }
  31.  
  32.     printWords("ARKADEMY");
  33. ?>
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top