some php functions used in WordPress source code

strip_tags("hello <p> world</p>")–> “hello word”

list($a,$b,$c)=$myarray; $a<=$myarray[0],$b<=$myarray[1],$c=$myarray[2]

compact("variablename1","variablename2",...") returns an array whose members are "variablename1"=>$variablename1, "variablename2"=>$variablename2, …. if $variablename is not in the current scope, compact won’t include it.

array_rand($arr) randomly picks up an entry from the array $arr and returns its key.

array_count_values($arr) counts the frequency of values of $arr and return an array with values as the keys and their frequencies as the values.

preg_match_all($pattern,$str,$matches) finds all matches of $pattern in $str, and puts the results to $matches. $matches[0] stores all matches of the pattern. $matches[1] stores all strings that matched the first parenthesized subpattern, $matches[2] stores all strings that matched the second parenthesized subpattern, and so on.

Did you like this?
Tip admin with Cryptocurrency

Donate Bitcoin to admin

Scan to Donate Bitcoin to admin
Scan the QR code or copy the address below into your wallet to send some bitcoin:

Donate Bitcoin Cash to admin

Scan to Donate Bitcoin Cash to admin
Scan the QR code or copy the address below into your wallet to send bitcoin:

Donate Ethereum to admin

Scan to Donate Ethereum to admin
Scan the QR code or copy the address below into your wallet to send some Ether:

Donate Litecoin to admin

Scan to Donate Litecoin to admin
Scan the QR code or copy the address below into your wallet to send some Litecoin:

Donate Monero to admin

Scan to Donate Monero to admin
Scan the QR code or copy the address below into your wallet to send some Monero:

Donate ZCash to admin

Scan to Donate ZCash to admin
Scan the QR code or copy the address below into your wallet to send some ZCash:

Leave a Reply