本文是php-redis中文文檔的第四部分,有需要的朋友可以參考下。
本文是php-redis中文文檔的第四部分,有需要的朋友可以參考下。 getRange (方法不存在) 返回名稱為key的string中start至end之間的字符 $redis->set('key', 'string value'); $redis->getRange('key', 0, 5); $redis->getRange('key', -5, -1); setRange (方法不存在) 改變key的string中start至end之間的字符為value $redis->set('key', 'Hello world'); $redis->setRange('key', 6, "redis"); $redis->get('key'); strlen 得到key的string的長度 $redis->strlen('key'); getBit/setBit 返回2進(jìn)制信息 zset(sorted set)操作相關(guān) zAdd(key, score, member):向名稱為key的zset中添加元素member,score用于排序。如果該元素已經(jīng)存在,則根據(jù)score更新該元素的順序。 $redis->zAdd('key', 1, 'val1'); $redis->zAdd('key', 0, 'val0'); $redis->zAdd('key', 5, 'val5'); $redis->zRange('key', 0, -1); // array(val0, val1, val5) zRange(key, start, end,withscores):返回名稱為key的zset(元素已按score從小到大排序)中的index從start到end的所有元素 $redis->zAdd('key1', 0, 'val0'); $redis->zAdd('key1', 2, 'val2'); $redis->zAdd('key1', 10, 'val10'); $redis->zRange('key1', 0, -1); // with scores $redis->zRange('key1', 0, -1, true); zDelete, zRem zRem(key, member) :刪除名稱為key的zset中的元素member $redis->zAdd('key', 0, 'val0'); $redis->zAdd('key', 2, 'val2'); $redis->zAdd('key', 10, 'val10'); $redis->zDelete('key', 'val2'); $redis->zRange('key', 0, -1); zRevRange(key, start, end,withscores):返回名稱為key的zset(元素已按score從大到小排序)中的index從start到end的所有元素.withscores: 是否輸出socre的值,默認(rèn)false,不輸出 $redis->zAdd('key', 0, 'val0'); $redis->zAdd('key', 2, 'val2'); $redis->zAdd('key', 10, 'val10'); $redis->zRevRange('key', 0, -1); // with scores $redis->zRevRange('key', 0, -1, true); zRangeByScore, zRevRangeByScore $redis->zRangeByScore(key, star, end, array(withscores, limit )); 返回名稱為key的zset中score >= star且score zCount(key, star, end); 返回名稱為key的zset中score >= star且score zRemRangeByScore('key', star, end); 刪除名稱為key的zset中score >= star且score zScore(key, val2); 返回名稱為key的zset中元素val2的score zRank, zRevRank $redis->zRevRank(key, val); 返回名稱為key的zset(元素已按score從小到大排序)中val元素的rank(即index,從0開始),若沒有val元素,返回“null”。zRevRank 是從大到小排序 zIncrBy $redis->zIncrBy('key', increment, 'member'); 如果在名稱為key的zset中已經(jīng)存在元素member,則該元素的score增加increment;否則向集合中添加該元素,其score的值為increment zUnion/zInter 參數(shù) keyOutput arrayZSetKeys arrayWeights aggregateFunction Either "SUM", "MIN", or "MAX": defines the behaviour to use on duplicate entries during the zUnion. 對N個(gè)zset求并集和交集,并將最后的集合保存在dstkeyN中。對于集合中每一個(gè)元素的score,在進(jìn)行AGGREGATE運(yùn)算前,都要乘以對于的WEIGHT參數(shù)。如果沒有提供WEIGHT,默認(rèn)為1。默認(rèn)的AGGREGATE是SUM,即結(jié)果集合中元素的score是所有集合對應(yīng)元素進(jìn)行SUM運(yùn)算的值,而MIN和MAX是指,結(jié)果集合中元素的score是所有集合對應(yīng)元素中最小值和最大值。 |

? 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 () {} /? ?? ?? ??? ????? ??? ?? ?? ?? ??? ???? ????? ???? ??? ?? ???? ???? ??? ? ??? ??????.

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

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

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)? ?? ??? ??? ??? ??????. ?? ???????? ???? ??? ???? ?? ???? ?? ?? ???? ?????? ??? ????? ?? ??? ?? ??? ???? ???? ?? ????.
