[ Index ] |
PHP Cross Reference of DokuWiki |
[Source view] [Print] [Project Stats]
Common String Functions PHP version 5
Author: | Jim Wigginton |
Copyright: | 2016 Jim Wigginton |
License: | http://www.opensource.org/licenses/mit-license.html MIT License |
Link: | http://phpseclib.sourceforge.net |
File Size: | 505 lines (16 kb) |
Included or required: | 0 times |
Referenced: | 0 times |
Includes or requires: | 0 files |
shift(&$string, $index = 1) X-Ref |
String Shift Inspired by array_shift param: string $string param: int $index return: string |
pop(&$string, $index = 1) X-Ref |
String Pop Inspired by array_pop param: string $string param: int $index return: string |
unpackSSH2($format, &$data) X-Ref |
Parse SSH2-style string Returns either an array or a boolean if $data is malformed. Valid characters for $format are as follows: C = byte b = boolean (true/false) N = uint32 Q = uint64 s = string i = mpint L = name-list uint64 is not supported. param: string $format param: string $data return: mixed |
packSSH2($format, ...$elements) X-Ref |
Create SSH2-style string param: string $format param: string|int|float|array|bool ...$elements return: string |
formatPack($format) X-Ref |
Expand a pack string Converts C5 to CCCCC, for example. param: string $format return: string |
bits2bin($x) X-Ref |
Convert binary data into bits bin2hex / hex2bin refer to base-256 encoded data as binary, whilst decbin / bindec refer to base-2 encoded data as binary. For the purposes of this function, bin refers to base-256 encoded data whilst bits refers to base-2 encoded data param: string $x return: string |
bin2bits($x, $trim = true) X-Ref |
Convert bits to binary data param: string $x return: string |
switchEndianness($x) X-Ref |
Switch Endianness Bit Order param: string $x return: string |
increment_str(&$var) X-Ref |
Increment the current string param: string $var return: string |
is_stringable($var) X-Ref |
Find whether the type of a variable is string (or could be converted to one) param: mixed $var return: bool |
base64_decode($data) X-Ref |
Constant Time Base64-decoding ParagoneIE\ConstantTime doesn't use libsodium if it's available so we'll do so ourselves. see https://github.com/paragonie/constant_time_encoding/issues/39 param: string $data return: string |
base64url_decode($data) X-Ref |
Constant Time Base64-decoding (URL safe) param: string $data return: string |
base64_encode($data) X-Ref |
Constant Time Base64-encoding param: string $data return: string |
base64url_encode($data) X-Ref |
Constant Time Base64-encoding (URL safe) param: string $data return: string |
hex2bin($data) X-Ref |
Constant Time Hex Decoder param: string $data return: string |
bin2hex($data) X-Ref |
Constant Time Hex Encoder param: string $data return: string |