nik_crimea

Untitled

Aug 17th, 2019
71
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. if ($str == '')
  2. return '';
  3. do {
  4. $str = str_replace(" ", " ", $str, $count);
  5. $f = $count === 0 ? false : true;
  6. } while ($f === true);
  7. if ($str == '' or $str == ' ')
  8. return '';
  9. if ($str[0] == ' ')
  10. $str[0] = '';
  11. $str[0] = $str[0] == ' ' ? '' : $str[0];
  12. $last = strlen($str)-1;
  13. $str[$last] = $str[$last] == ' ' ? '' : $str[$last];
  14. $str = strtolower($str);
  15. $str = str_replace(" ", "-", $str);
  16. return $str;
RAW Paste Data