[ 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 return: string param: string $string param: int $index |
pop(&$string, $index = 1) X-Ref |
String Pop Inspired by array_pop return: string param: string $string param: int $index |
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. return: mixed param: string $format param: string $data |
packSSH2($format, ...$elements) X-Ref |
Create SSH2-style string return: string param: string $format param: string|int|float|array|bool ...$elements |
formatPack($format) X-Ref |
Expand a pack string Converts C5 to CCCCC, for example. return: string param: string $format |
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 return: string param: string $x |
bin2bits($x, $trim = true) X-Ref |
Convert bits to binary data return: string param: string $x |
switchEndianness($x) X-Ref |
Switch Endianness Bit Order return: string param: string $x |
increment_str(&$var) X-Ref |
Increment the current string return: string param: string $var |
is_stringable($var) X-Ref |
Find whether the type of a variable is string (or could be converted to one) return: bool param: mixed $var |
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 return: string param: string $data |
base64url_decode($data) X-Ref |
Constant Time Base64-decoding (URL safe) return: string param: string $data |
base64_encode($data) X-Ref |
Constant Time Base64-encoding return: string param: string $data |
base64url_encode($data) X-Ref |
Constant Time Base64-encoding (URL safe) return: string param: string $data |
hex2bin($data) X-Ref |
Constant Time Hex Decoder return: string param: string $data |
bin2hex($data) X-Ref |
Constant Time Hex Encoder return: string param: string $data |