wip
This commit is contained in:
1 parent
8325f3a334
commit
5188d1f171
2 files changed
+9
-61
No files matched your search
@@ -384,4 +384,13 @@ trait GrappingHelper
|
||||
|
||||
return $results;
|
||||
}
|
||||
|
||||
protected function clean_string(string $string)
|
||||
{
|
||||
$string = str_replace(' ', '-', $string); // Replaces all spaces with hyphens.
|
||||
$string = preg_replace('/[^A-Za-z0-9\-]/', '', $string); // Removes special chars.
|
||||
$string = strtolower($string);
|
||||
|
||||
return preg_replace('/-+/', '-', $string); // Replaces multiple hyphens with single one.
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user