enable_post_data_reading = Off
UPDATE `users` SET `name`=CONVERT(UNHEX(HEX(CONVERT(`name` using latin1))) using cp1251);
function getip4mask($bits) {
$ret = 0;
for($i = 0; $i < $bits; $i++)
$ret |= 1 << 31-$i;
return $ret;
}
$cidr = '84.22.142.192/27';
$matches = null;
if(preg_match('/^((?:(?:(2(?:5[0-5]|[0-4]\d))|1*[0-9]{0,2})\.){3}(?3))\/(\d|[1-2]\d|3[0-2])$/', $cidr, $matches))
{
list('1' => $ip4, '3' => $bits) = $matches;
$ip4l = ip2long($ip4);
$maskl = getip4mask($bits);
$first_ip = $bits == 32 ? $ip4l : ($ip4l & $maskl) + 1;
echo long2ip($first_ip),"\n";
echo long2ip($maskl),"\n";
}
<input type="hidden" name="post_id" value="$post_id" />
var post_id=$(this).parents(".post_container").children("input[name=post_id]").val());
function getXmlRow($xml, $time, $day, $price, $description) {
$names = array('time', 'day', 'price', 'description');
$ret = $xml->createElement('date');
foreach($names as $name){
$ret->appendChild($xml->createElement($name, $$name));
}
return $ret;
}
$xml = new DomDocument('1.0', 'UTF-8');
$dates = $xml->createElement('dates');
for($i=0; $i <= 3; $i++)
$dates->appendChild(getXmlRow($xml, '21:16', '2021-01-26', 6000, 'Delete project AND Serch a PHP learning'));
$xml->appendChild($dates);
echo $xml->saveXML();
$text = "Привет, мир!";
$len = mb_strlen($text);
for($i=0; $i < $len; $i++)
echo mb_substr($text, $i, 1), "\n";