首页 > 大数据 > 数据挖掘 > PHP - 为什么说5G时代最好的语言



<?php$arr = [ 0 => ['name' => 'stark' ,'age' => 30 ], 1 => ['name' => 'irco' ,'age' => 35 ], ];$name = 'stark 张';debug_zval_dump($name);// string(8) "stark 张" refcount(1)?>


<?php class Deque { public $queue = array(); /**(尾部)入队 **/ public function addLast($value) { return array_push($this->queue,$value); } /**(尾部)出队**/ public function removeLast() { return array_pop($this->queue); } /**(头部)入队**/ public function addFirst($value) { return array_unshift($this->queue,$value); } /**(头部)出队**/ public function removeFirst() { return array_shift($this->queue); } /**清空队列**/ public function makeEmpty() { unset($this->queue); } /**获取列头**/ public function getFirst() { return reset($this->queue); } /** 获取列尾 **/ public function getLast() { return end($this->queue); } /** 获取长度 **/ public function getLength() { return count($this->queue); } }
{ "name": "laravel/laravel", "type": "project", "description": "The Laravel Framework.", "keywords": [ "framework", "laravel" ], "license": "MIT", "require": { "php": "^7.2", "fideloper/proxy": "^4.0", "laravel/framework": "^6.2", "laravel/tinker": "^1.0" }, ......
Collection {#320 ▼ #items: array:5 [▼ 0 => Article {#321 ▼ #table: "art_article" #primaryKey: "art_id" +timestamps: false #field: array:13 [▶] ...... }
$redis=new Redis;$redis->connect('127.0.0.1',6379);
<?php error_reporting( E_ALL ); set_time_limit( 0 ); ob_implicit_flush(); $socket = socket_create( AF_INET, SOCK_DGRAM, SOL_UDP ); if ( $socket === false ) { echo "socket_create() failed:reason:" . socket_strerror( socket_last_error() ) . "\n"; } $ok = socket_bind( $socket, '202.85.218.133', 11109 ); if ( $ok === false ) { echo "socket_bind() failed:reason:" . socket_strerror( socket_last_error( $socket ) ); } while ( true ) { $from = ""; $port = 0; socket_recvfrom( $socket, $buf,1024, 0, $from, $port ); echo $buf; usleep( 1000 ); }
<?php //error_reporting( E_ALL ); set_time_limit( 0 ); ob_implicit_flush(); $socket = socket_create( AF_INET, SOCK_STREAM, SOL_TCP ); socket_bind( $socket, '192.168.2.143', 11109 ); socket_listen($socket); $acpt=socket_accept($socket); echo "Acpt!\n"; while ( $acpt ) { $words=fgets(STDIN); socket_write($acpt,$words); $hear=socket_read($acpt,1024); echo $hear; if("bye\r\n"==$hear){ socket_shutdown($acpt); break; } usleep( 1000 ); } socket_close($socket);

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/69963428/viewspace-2743573/ ,如需转载,请注明出处,否则将追究法律责任。