×

Welcome to TagMyCode

Please login or create account to add a snippet.
0
0
 
0
Language: PHP
Posted by: Javier Lopez
Added: Oct 12, 2018 10:16 PM
Views: 3471
Tags: no tags
  1. public function clean($string) {
  2.    $string = str_replace(' ', '+', $string);
  3.    return preg_replace('/[^A-Za-z0-9\+]/', '', $string);
  4. }