Tag Archives: PHP

An interesting PHP Example

<?php class A { protected static $actions = array(); public static function addAction( $fname, $fn ){ self::$actions[ $fname ] = $fn; } function __get( $name ){ $arr = self::$actions; if( key_exists( $name, $arr ) ){ return $arr[ $name ]; } … Continue reading

Posted in PHP | Tagged | 3 Comments

php get uuid from mysql

<?php /** * get uuid from mysql * first you need to setup your mysql connection * * @return uuid-string uuid string **/ function uuid(){ $r = mysql_query( “select uuid()” ); $row = mysql_fetch_array( $r ); $uuid = $row[0]; return … Continue reading

Posted in PHP | Tagged , , | 3 Comments

php uuid

/** * Generates an UUID * * @author Huang Xinhao <info@softwarematrix.cn> * @param string an optional prefix string * @return string the formatted uuid string */ function uuid( $prefix = ” ) { $chars = md5( uniqid( mt_rand(), true ) … Continue reading

Posted in PHP | Tagged , | 4 Comments
Page 1 of 612345...Last »