$json = utf8_encode($str);
$results = json_decode($json, TRUE);
var_dump($json);
$json = json_decode(json_encode($str, JSON_UNESCAPED_UNICODE), TRUE);
var_dump($json);
const url="http://example.com/roomUser/BootData.php";
fetch(url)
.then(response => response.json())
.then(BootData => {
console.log(BootData);
});
const url="http://example.com/roomUser/BootData.php";
fetch(url)
.then(response => response.json().then(BootData => {
console.log(BootData);
}));
require "../sqlconnect.php"; #Подключение к бд через pdo
$username = trim(filter_var($_POST['username'], FILTER_SANITIZE_STRING));
$email = trim(filter_var($_POST['email'], FILTER_SANITIZE_EMAIL));
$login = trim(filter_var($_POST['login'], FILTER_SANITIZE_STRING));
$password = trim(filter_var($_POST['password'], FILTER_SANITIZE_STRING));
$error = '';
if(strlen($username) <= 3){
$error = 'Введите имя';
}else if(strlen($email) <= 3){
$error = 'Введите емейл';
}else if(strlen($login) <= 5){
$error = 'Введите логин';
}else if(strlen($password) < 8){
$error = 'Введите пароль';
}
if ($error != '') {
echo $error;
exit;
}
$hash = "3h#%89*H#($h%!~fh";
$password = md5($password);
$sql = 'INSERT INTO `userinfo` (`name`, `email`, `login`, `password`) VALUES(?,?,?,?)';
$query = $pdo->prepare($sql);
$query->execute([$username, $email, $login, $password]);
echo 'Готово';
require "../sqlconnect.php";
-> $password = '';
, он перезаписывает Вашу переменную на пустую строку. /*eslint no-mixed-operators: "error"*/
.block {
clip-path: polygon(0% 40%,100% 0%,100% 100%,0% 100%) margin-box;
margin: 0;
}
попробуйте так..border-radius: 5px 0 0 0;
border-top-right-radius: 5px;
borde-top-left-radius: 5px;
borde-bottom-right-radius: 5px
borde-bottom-left-radius: 5px
border-radius: 5px;
var url_json = 'https://www.site.com/json.txt';
function init(){
fetch(url_json)
.then(response => response.json())
.then(_json => {
let artist = document.getElementById('artist');
let title= document.getElementById('title');
artist.innerHTML = _json.artist;
title.innerHTML = _json.title;
});
}
setInterval(init,1000);
var url_json = 'https://www.site.com/json.txt';
function init(){
fetch(url_json)
.then(response => response.json().then(_json => {
let artist = document.getElementById('artist');
let title= document.getElementById('title');
artist.innerHTML = _json.artist;
title.innerHTML = _json.title;
}));
}
setInterval(init,1000);
<div class="content">
<div class="filter">
<p>Текст - 1</p>
</div>
<div class="filter">
<p>Текст - 2</p>
</div>
<div class="filter">
<p>Текст - 3</p>
</div>
<div class="filter">
<p>Текст - 4</p>
</div>
<div class="filter">
<p>Текст - 5</p>
</div>
<div class="filter" hidden>
<p>Текст - 6</p>
</div>
<div class="filter" hidden>
<p>Текст - 7</p>
</div>
<div class="filter" hidden>
<p>Текст - 8</p>
</div>
<div class="filter" hidden>
<p>Текст - 9</p>
</div>
<div class="filter" hidden>
<p>Текст - 10</p>
</div>
<p class="show_content">Показать остальное</p>
</div>
$(document).ready(() => {
$('body').on('click', '.show_content' , () => {
var scrollToProduct = $('.filter:hidden');
$('.filter:hidden:lt(5)').slideDown(1000);
if (scrollToProduct.length === 0) $('.show_content').hide() ;
$('html, body').animate({
scrollTop: scrollToProduct.offset().top
}, 1000);
});
});
$(document).ready(() => {
$('body').on('click', '.show_content' , () => {
var scrollToProduct = $('.filter:hidden');
$('.filter:hidden').slideDown(1000);
if (scrollToProduct.length === 0) $('.show_content').hide() ;
$('html, body').animate({
scrollTop: scrollToProduct.offset().top
}, 1000);
});
});
$(document).ready(() => {
$('body').on('click', '.show_content' , () => {
var scrollToProduct = $('.filter:hidden');
$('.filter:hidden').show();
if (scrollToProduct.length === 0) $('.show_content').hide() ;
});
});
$.get('http://work-market-api.local/api/posts', {},
function (response) {
var dataObj = JSON.parse(response);
var arr = [];
for(var i in dataObj) {
arr[i] = [];
for(var index in dataObj[index]) {
arr[i][index] = dataObj[i][index];
}
}
console.log(arr);
});
$result = [];
if(...) {
foreach(... as ...) {
$images = $this->model_catalog_product->getProductImages($result['product_id']);
if(isset($images[0]['image']) && !empty($images)){
$images = $images[0]['image'];
} else {
$images = $image;
}
}