urlshortener/lib/functions.inc.php

22 lines
391 B
PHP
Raw Permalink Normal View History

2013-09-26 16:03:50 +00:00
<?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);
}