util.php 438 B

1234567891011121314
  1. <?php
  2. require_once('../config/linequest.php');
  3. function cleanTitle ($title) {
  4. $clearstring = filter_var($title, FILTER_SANITIZE_STRING, FILTER_FLAG_STRIP_HIGH);
  5. $clearstring = trim(preg_replace("/[^a-zA-Z0-9 ]/",'',$clearstring));
  6. $clearstring = trim(preg_replace("/[[:space:]]+/",'_',$clearstring));
  7. return strtolower($clearstring);
  8. }
  9. function generateURI ($path) {
  10. global $CFG;
  11. return $CFG->server_uri.$path;
  12. }