本文是php-redis中文文檔的第五部分,有需要的朋友可以參考下。
本文是php-redis中文文檔的第五部分,有需要的朋友可以參考下。 Hash操作 hSet $redis->hSet('h', 'key1', 'hello'); 向名稱為h的hash中添加元素key1—>hello hGet $redis->hGet('h', 'key1'); 返回名稱為h的hash中key1對(duì)應(yīng)的value(hello) hLen $redis->hLen('h'); 返回名稱為h的hash中元素個(gè)數(shù) hDel $redis->hDel('h', 'key1'); 刪除名稱為h的hash中鍵為key1的域 hKeys $redis->hKeys('h'); 返回名稱為key的hash中所有鍵 hVals $redis->hVals('h') 返回名稱為h的hash中所有鍵對(duì)應(yīng)的value hGetAll $redis->hGetAll('h'); 返回名稱為h的hash中所有的鍵(field)及其對(duì)應(yīng)的value hExists $redis->hExists('h', 'a'); 名稱為h的hash中是否存在鍵名字為a的域 hIncrBy $redis->hIncrBy('h', 'x', 2); 將名稱為h的hash中x的value增加2 hMset $redis->hMset('user:1', array('name' => 'Joe', 'salary' => 2000)); 向名稱為key的hash中批量添加元素 hMGet $redis->hmGet('h', array('field1', 'field2')); 返回名稱為h的hash中field1,field2對(duì)應(yīng)的value redis 操作相關(guān) flushDB 清空當(dāng)前數(shù)據(jù)庫(kù) flushAll 清空所有數(shù)據(jù)庫(kù) randomKey 隨機(jī)返回key空間的一個(gè)key $key = $redis->randomKey(); select 選擇一個(gè)數(shù)據(jù)庫(kù) move 轉(zhuǎn)移一個(gè)key到另外一個(gè)數(shù)據(jù)庫(kù) $redis->select(0); // switch to DB 0 $redis->set('x', '42'); // write 42 to x $redis->move('x', 1); // move to DB 1 $redis->select(1); // switch to DB 1 $redis->get('x'); // will return 42 rename, renameKey 給key重命名 $redis->set('x', '42'); $redis->rename('x', 'y'); $redis->get('y'); // → 42 $redis->get('x'); // → `FALSE` renameNx 與remane類似,但是,如果重新命名的名字已經(jīng)存在,不會(huì)替換成功 setTimeout, expire 設(shè)定一個(gè)key的活動(dòng)時(shí)間(s) $redis->setTimeout('x', 3); expireAt key存活到一個(gè)unix時(shí)間戳?xí)r間 $redis->expireAt('x', time() 3); keys, getKeys 返回滿足給定pattern的所有key $keyWithUserPrefix = $redis->keys('user*'); dbSize 查看現(xiàn)在數(shù)據(jù)庫(kù)有多少key $count = $redis->dbSize(); auth 密碼認(rèn)證 $redis->auth('foobared'); bgrewriteaof 使用aof來(lái)進(jìn)行數(shù)據(jù)庫(kù)持久化 $redis->bgrewriteaof(); slaveof 選擇從服務(wù)器 $redis->slaveof('10.0.1.7', 6379); save 將數(shù)據(jù)同步保存到磁盤(pán) bgsave 將數(shù)據(jù)異步保存到磁盤(pán) lastSave 返回上次成功將數(shù)據(jù)保存到磁盤(pán)的Unix時(shí)戳 info 返回redis的版本信息等詳情 type 返回key的類型值 string: Redis::REDIS_STRING set: Redis::REDIS_SET list: Redis::REDIS_LIST zset: Redis::REDIS_ZSET hash: Redis::REDIS_HASH other: Redis::REDIS_NOT_FOUND |

? AI ??

Undress AI Tool
??? ???? ??

Undresser.AI Undress
???? ?? ??? ??? ?? AI ?? ?

AI Clothes Remover
???? ?? ???? ??? AI ?????.

Clothoff.io
AI ? ???

Video Face Swap
??? ??? AI ?? ?? ??? ???? ?? ???? ??? ?? ????!

?? ??

??? ??

???++7.3.1
???? ?? ?? ?? ???

SublimeText3 ??? ??
??? ??, ???? ?? ????.

???? 13.0.1 ???
??? PHP ?? ?? ??

???? CS6
??? ? ?? ??

SublimeText3 Mac ??
? ??? ?? ?? ?????(SublimeText3)

PHP ?? ??? ?? ???? ?? ? ????? ??? ?????. 1. ?? ??? ??? ??? ??? ? ? ??? ??? ??? ?? ?? ??? ???? ???????. 2. ?? ??? ???? ???? ? ?? ????? ?? ?? ?? ??? ?????. 3. $ _get ? $ _post? ?? Hyperglobal ??? ?? ???? ?? ??? ? ??? ??? ??????? ???????. 4. ?? ?? ?? ???? ?? ?? ?? ??? ?????? ?? ??? ??? ?? ??? ???????. ??? ??? ????? ??? ??? ?? ???? ????? ? ??? ? ? ????.

PHP ?? ???? ???? ????? ?? ? ??? ???? ?? ?? ? ??? ???? ?? ??? ?????? ??? ??? ? ? ???????. 1. ??? ?? CSRF? ???? ?? ??? ??? ???? ?????? ??? ???? FINFO_FILE? ?? ?? MIME ??? ?????. 2. ??? ??? ??? ???? ??? ?? ??? ?? ? WEB ????? ??? ???? ??????. 3. PHP ?? ??? ?? ? ?? ???? NGINX/APACHE? ??? ????? ?? ???? ?????. 4. GD ?????? ??? ? ?? ???? ??? ?? ??? ?? ????.

PHP ?? ???? ? ?? ???? ??? ????. 1. // ?? #? ???? ? ?? ??? ???? // ???? ?? ????. 2. ?? /.../ ?? ?? ?? ??? ????? ?? ? ?? ??? ?? ? ? ????. 3. ?? ?? ?? / if () {} /? ?? ?? ??? ????? ??? ?? ?? ?? ??? ???? ????? ???? ??? ?? ???? ???? ??? ? ??? ??????.

PHP ??? ???? ??? ??? ??? ????? ????. ??? ????? ?? ???? ??? "?? ? ?"??? "?"? ???????. 1. ??? ? ??? ??? DocBlock (/*/)? ?? ?? ??? ???? ??? ? ?? ???? ??????. 2. JS ??? ???? ?? ???? ??? ?? ??? ??? ?????. 3. ??? ?? ?? ?? ??? ???? ????? ????? ???? ?? ????? ???? ? ??????. 4. Todo ? Fixme? ????? ???? ? ? ??? ??? ???? ?? ?? ? ??? ???????. ??? ???? ?? ??? ??? ?? ?? ?? ???? ???? ? ????.

Ageneratorinphpisamemory- ???? Way-Erate-Overgedatasetsetsbaluesoneatimeatimeatimeatimallatonce.1.generatorsuseTheyieldKeywordTocroadtOpvaluesondemand, RetingMemoryUsage.2

tolearnpheffectical, startBysetTupaloCalserErverEnmentUsingToolslikexamppandacodeeditor -likevscode.1) installxamppforapache, mysql, andphp.2) useacodeeditorforsyntaxsupport.3)) 3) testimplephpfile.next, withpluclucincludechlucincluclucludechluclucled

toinstallphpquickly, usexampponwindowsorhomebrewonmacos.1. ??, downloadandinstallxAmpp, selectComponents, startApache ? placefilesinhtdocs.2

PHP??? ???? ??? ?? ?? ????? ???? ??? ?? ??? ??? ?? ? ??? ??? ???? ?????. ???? 0?? ???? ?? ??? ???? ? ?? ???? ?? ?? ? ? ????. MB_SUBSTR? ?? ??? ??? ???????. ? : $ str = "hello"; echo $ str [0]; ?? H; ??? MB_SUBSTR ($ str, 1,1)? ?? ??? ??? ??? ??????. ?? ???????? ???? ??? ???? ?? ???? ?? ?? ???? ?????? ??? ????? ?? ??? ?? ??? ???? ???? ?? ????.
