/** * @return string */ public static function fromCharCode() { return array_reduce(func_get_args(), function ($a, $b) { $a .= LZString::utf8_chr($b); return $a; }); }
public static function fromCharCode() { $args = func_get_args(); // var_dump($args[0].': '.array_reduce(func_get_args(),function($a,$b){$a.=self::utf8_chr($b);return $a;})); return array_reduce(func_get_args(), function ($a, $b) { $a .= LZString::utf8_chr($b); return $a; }); }
<?php require_once '../src/LZString.php'; $codeChecks = 10; $rows = 5; $digits = 5; $set = array(); for ($i = 0; $i < $rows; $i++) { $str = ''; for ($j = 0; $j < $digits; $j++) { $str .= LZString::utf8_chr(rand(34, 123)); } $set[] = $str; } $test = array_key_exists('testString', $_POST) ? $_POST['testString'] : 'Test this text'; $testPHP = LZString::compressToBase64($test); //$testPHP = 'IoDQKgcgIgogsgBgErAWhBGIAAA='; $testPHPdec = LZString::decompressFromBase64($testPHP); $codeChecks = 10; //$set = array(); //$set = array(1,2,3,4,5,6,7,8,9); //$set = array('fqYW{'); //$set = array('/L>[s'); //$set = array('["806","805"]'); ?> <!DOCTYPE html> <!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]--> <!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8"> <![endif]--> <!--[if IE 8]> <html class="no-js lt-ie9"> <![endif]--> <!--[if gt IE 8]><!--> <html class="no-js"> <!--<![endif]-->