mirror of
				https://github.com/pierre42100/ComunicAPI
				synced 2025-11-04 12:14:12 +00:00 
			
		
		
		
	Created mysql_date() function
This commit is contained in:
		@@ -14,7 +14,7 @@
 | 
			
		||||
 *                         to select from
 | 
			
		||||
 * @return string
 | 
			
		||||
 */
 | 
			
		||||
function random_str($length, $keyspace = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ')
 | 
			
		||||
function random_str(int $length, string $keyspace = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ')
 | 
			
		||||
{
 | 
			
		||||
    $str = '';
 | 
			
		||||
    $max = mb_strlen($keyspace, '8bit') - 1;
 | 
			
		||||
@@ -23,3 +23,13 @@ function random_str($length, $keyspace = '0123456789abcdefghijklmnopqrstuvwxyzAB
 | 
			
		||||
    }
 | 
			
		||||
    return $str;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Get the current date formatted for the "datetime" object of
 | 
			
		||||
 * a Mysql database
 | 
			
		||||
 * 
 | 
			
		||||
 * @return string Formatted string
 | 
			
		||||
 */
 | 
			
		||||
function mysql_date() : string {
 | 
			
		||||
    return date("Y-m-d h:i:s", time());
 | 
			
		||||
}
 | 
			
		||||
		Reference in New Issue
	
	Block a user