$uncomingString = 'W+I4zLZyeJDAhQMe33tYRcXC+Falj9baMfjJw5yOijaPNHDYcnNlRlTGm3rvA6cn2hXMmW4ZKEyTphwzNMQlOlnNiCHK2LLpJLgXK6JHKuTYeParwqCud5Vn2dZXpxctrQf8OkbCqF12u0GcBR2or2HFBrEV13Jd5YAX4bRbUBk=';
function forceUnicode( $str = '' )
{
$result = '';
for( $i=0,$length=strlen($str); $i<$length; $i++)
{
$result .= "\\u".str_pad(bin2hex($str[$i]), 4, '0', STR_PAD_LEFT);
}
return $result;
}
echo forceUnicode($uncomingString);
/*
Выведет:
\u0057\u002b\u0049\u0034\u007a\u004c\u005a\u0079\u0065\u004a\u0044\u0041\u0068\u0051\u004d\u0065\u0033\u0033\u0074\u0059\u0052\u0063\u0058\u0043\u002b\u0046\u0061\u006c\u006a\u0039\u0062\u0061\u004d\u0066\u006a\u004a\u0077\u0035\u0079\u004f\u0069\u006a\u0061\u0050\u004e\u0048\u0044\u0059\u0063\u006e\u004e\u006c\u0052\u006c\u0054\u0047\u006d\u0033\u0072\u0076\u0041\u0036\u0063\u006e\u0032\u0068\u0058\u004d\u006d\u0057\u0034\u005a\u004b\u0045\u0079\u0054\u0070\u0068\u0077\u007a\u004e\u004d\u0051\u006c\u004f\u006c\u006e\u004e\u0069\u0043\u0048\u004b\u0032\u004c\u004c\u0070\u004a\u004c\u0067\u0058\u004b\u0036\u004a\u0048\u004b\u0075\u0054\u0059\u0065\u0050\u0061\u0072\u0077\u0071\u0043\u0075\u0064\u0035\u0056\u006e\u0032\u0064\u005a\u0058\u0070\u0078\u0063\u0074\u0072\u0051\u0066\u0038\u004f\u006b\u0062\u0043\u0071\u0046\u0031\u0032\u0075\u0030\u0047\u0063\u0042\u0052\u0032\u006f\u0072\u0032\u0048\u0046\u0042\u0072\u0045\u0056\u0031\u0033\u004a\u0064\u0035\u0059\u0041\u0058\u0034\u0062\u0052\u0062\u0055\u0042\u006b\u003d
*/if (isset($brand)){if ( !empty($brand) ) {$query = "SELECT * FROM products WHERE brand = '".$_POST["category"]."' ";array(2) {
["a"]=>
string(1) "0"
["b"]=>
string(1) "5"
}$result = [];
$a = (int) $_POST['a'];
$b = (int) $_POST['b'];
$c = array_filter( (array) $_POST['day'] );
if ( !empty($c) )
{
$c = implode(',', $_POST['day']);
$in = str_repeat('?,', count($c) - 1) . '?';
$sql = "SELECT * FROM table WHERE day IN ($in) ASC LIMIT :a, :b";
$stmt = $pdo->prepare($sql);
$stmt->execute($с, [$a, $b]);
$data = $stmt->fetchAll();
$result = $data;
}
echo json_encode($result);<form id="filter">
<input type='hidden' name='a' value='0' />
<input type='hidden' name='b' value='5' />
<input type="checkbox" name="day[]" value="1">
<input type="checkbox" name="day[]" value="2">
<input type="checkbox" name="day[]" value="3">
</form>$.ajax({
url: 'index.php',
method: 'POST',
data: $("#filter").serialize()
}); if ($_SERVER['REQUEST_METHOD'] == 'POST' && isset($_POST['edit'])) {
$editServiceById = $services->editServiceById($_GET['service_id'], $_POST);
}// Display errors
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);
// Log values
echo "<pre>";
var_dump($_SERVER['REQUEST_METHOD'], $_POST['edit'], isset($_POST['edit']));
echo "</pre>";
if ($_SERVER['REQUEST_METHOD'] == 'POST' && isset($_POST['edit'])) {
$editServiceById = $services->editServiceById($_GET['service_id'], $_POST);
}/**
* Prepare array for our job
*/
$arrayOne = [
0 => 80,
1 => 80,
2 => 90,
];
$arrayTwo = [
0 => [
0 => 190,
1 => 195,
],
1 => [
0 => 200,
],
2 => [
0 => 190,
1 => 195,
],
];
$arrayThree = [
0 => 1,
1 => 2,
2 => 3,
];
/**
* @var array Array with actual data in our structure
*/
$arResult = [];
foreach ( $arrayTwo as $iKeyOne => $arrayTwoElement )
{
// if in second array exist unknown key
if ( !array_key_exists($iKeyOne, $arrayOne) )
{
continue;
}
// if in third array exist unknown key
if ( !array_key_exists($iKeyOne, $arrayThree) )
{
continue;
}
// if in second array no elements
if ( empty($arrayTwoElement) || !is_array($arrayTwoElement) )
{
continue;
}
/* @var integer Key for first depth level */
$iLevelKey = (int) $arrayOne[ $iKeyOne ];
/* @var integer Value for second depth level */
$iLevelValue = (int) $arrayThree[ $iKeyOne ];
foreach ($arrayTwoElement as $k => $v)
{
$arResult[ $iLevelKey ][ $v ] = $iLevelValue;
}
}
var_dump($arResult);
/*
Will display:
array(2) {
[80]=>
array(3) {
[190]=> int(1)
[195]=> int(1)
[200]=> int(2)
}
[90]=>
array(2) {
[190]=> int(3)
[195]=> int(3)
}
}
*/ Что делать?
Во вкладке SEO, когда меняю пункты META и оставляю галочку на "Изменить для этого раздела и его подразделов", то изменения сохраняются, но они еще сохраняются в подразделов. Мне этого не надо, потому что у каждого подраздела будут свои МЕТА пункты.