$format_string = '{"one":"%s"}'; echo sprintf($format_string , json_encode ($html));
$data = ['one' => $html];
echo json_encode( $data );
let myForm = document.querySelector(".rf-form");
myForm.requestSubmit();
if (input.getAttribute("name") == "il.@ml.ru") {
input.setAttribute("value", "il.@ml.ru")
console.log(4);
}
if (input.getAttribute("value") == "il.@ml.ru") {
input.setAttribute("value", "iil.@ml.ruu")
console.log(5);
}
if (input.getAttribute("name") == "userEmail") {
input.setAttribute("value", "il.@ml.ru")
console.log(4);
}
как указать это в js?
$('.add_product').submit(function(e) {
//...
});
В этом то всё и дело, что новый дамп сделать не получиться.
<?php
const LATITUDE = 0;
const LONGITUDE = 1;
const EPSILON = 0.000000000001;
function isEquals( $a, $b ) {
return abs( $a - $b ) < EPSILON;
}
// Read the content of the json file
$json_file = file_get_contents('polygon.json');
// Decode the json content into an array of coordinates
$polygon = json_decode($json_file, true);
// Check if the request contains a coordinate to be verified
if(isset($_GET['coordinate'])){
$coordinate = explode(', ', $_GET['coordinate']); // запятая с пробелом
$is_inside = false;
// Loop through the array of coordinates
foreach ($polygon['geometry']['coordinates'] as $polygonPoints){
foreach ( $polygonPoints as $point ) {
// Check if the coordinate exists in the polygon
if( isEquals( $point[LATITUDE], $coordinate[LATITUDE] )
&& isEquals( $point[LONGITUDE], $coordinate[LONGITUDE] )
) {
$is_inside = true;
break;
}
}
}
// Output a positive or negative message
if($is_inside){
echo "The coordinate is inside the polygon";
}else{
echo "The coordinate is not inside the polygon";
}
}