HEX
Server: Microsoft-IIS/10.0
System: Windows NT ITPWINWEBSVR22 10.0 build 20348 (Windows Server 2022) AMD64
User: www.conferencesearch.co.uk (0)
PHP: 8.3.30
Disabled: NONE
Upload Files
File: D:/web/itpartnership.net (cms)/modules/FeedbackForm/classes/UtilityFunctions.class.php
<?php
// Feedback Form. 02/2005 SjG <feedbackform_cmsmodule@fogbound.net>
// A Module for CMS Made Simple, (c)2005 by Ted Kulp (wishy@cmsmadesimple.org)
// This project's homepage is: http://www.cmsmadesimple.org

class ffUtilityFunctions
    {
    // ---------------------------------------------------------------------------------
    // STUPID COMMON DATA MANIPULATION METHODS
    // ---------------------------------------------------------------------------------

	// returns true if a variable exists and has a non-null value, but could contain zero
    function def(&$var)
    {
    	if (!isset($var))
    	   {
    	   	return false;
    	   }
    	else if (is_null($var))
    	   {
    	   	return false;
    	   }
    	else if (!is_array($var) && empty($var))
    	   {
    	   	return false;
    	   }
    	else if (is_array($var) && count($var) == 0)
    	   {
    	   	return false;
    	   }
    	return true;
    }

    // creates a form-safe alias string
    function MakeAlias($string, $isForm=false)
    {
    	$string = trim($string);
        $string = preg_replace("/[_-\W]+/", "_", $string);
		$string = trim($string, '_');
		if ($isForm)
		  {
		  return strtolower($string);
		  }
		else
		  {
		  return 'ff'.strtolower($string);
		  }
    }    
}
?>