tags | ||
---|---|---|
|
In the CI process, there are some lines about setting configuration files like this:
<?php | |
function parseSOAP(string $response): array | |
{ | |
$content = preg_replace("/(<\/?)(\w+):([^>]*>)/", "$1$2$3", $response); | |
$xml = new SimpleXMLElement($content); | |
$body = $xml->xpath('//sBody')[0]; // 'sBody' is from '<s:Body>', the body tag in your xml file. | |
$json = json_encode((array)$body, JSON_THROW_ON_ERROR); | |
$data = json_decode($json, true, 512, JSON_THROW_ON_ERROR); | |
use information_schema; | |
select ROUND(SUM(data_length + index_length) / 1024 / 1024, 1) "DB size in MB" from tables; |
// User .length to do so. | |
if ($('#id').length) { | |
// do something. | |
} |
/usr/bin/php /var/www/public/vendor/phpunit/phpunit/phpunit --bootstrap vendor/silverstripe/framework/tests/bootstrap.php account/tests/CorporateTaxManagerUploaderTest.php flush=1 |
<?php | |
$arr = ['123-123-123', '111-111-111']; | |
$a = 123; | |
var_dump(in_array($a, $arr)); // true | |
var_dump(in_array($a, $arr, true)); // false |
<?php | |
$token = bin2hex(random_bytes(16)); |
if (performance.getEntriesByType("navigation")[0].type === 'back_forward') { | |
// do something. | |
} |