This repository has been archived on 2019-06-21. You can view files and clone it, but cannot push or open issues or pull requests.
sandpiper/utilities/transform.php

19 lines
256 B
PHP
Raw Normal View History

<?php
function slugify($string, $maxlength = 50) {
return preg_replace([
'\s+',
'[^a-z0-9\-_]'
], [
'-',
''
],
strtolower(trim($string))
);
}
function escape4xml($string) {
return htmlspecialchars($string, ENT_QUOTES | ENT_XML1);
}