urlshortener/lib/functions.inc.php

22 lines
391 B
PHP

<?php
/**
* Some useful functions
*/
function getRequestParameter($paramName) {
if (isset($_REQUEST[$paramName])) {
return $_REQUEST[$paramName];
}
return NULL;
}
function str_startswith($str, $with) {
if (($str == NULL) && ($with == NULL)) {
return true;
}
if (strlen($with) > strlen($str)) {
return false;
}
return (substr_compare($str, $with, 0, strlen($with)) == 0);
}