Advertisement
Guest User

Untitled

a guest
Jul 22nd, 2017
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.29 KB | None | 0 0
  1. <?php
  2.  
  3. $string = 'Some text Here that needs changing';
  4.  
  5. // lowercase it all.
  6. $string = strtolower($string);
  7.  
  8. // Explode it by spaces - this gives you an array.
  9. $array = explode(' ', $string);
  10.  
  11. // Then implode it back together using '-' as the seperator.
  12. $url = implode('-', $array);
  13.  
  14. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement