javascript access php variable
//passing PHP variable to JavaScript
var myJSVar = <?php echo json_encode($myPHPVar); ?>;
javascript access php variable
//passing PHP variable to JavaScript
var myJSVar = <?php echo json_encode($myPHPVar); ?>;
javascript parse php code
let cars = [
{
"id": 1,
"code": "C1",
"color": "purple",
"type": "minivan",
"registration": new Date('2017-01-03'),
"capacity": 7
},
{
"id": 2,
"code": "C2",
"color": "red",
"type": "station wagon",
"registration": new Date('2018-03-03'),
"capacity": 5
},
{
"id": 3,
"code": "C2",
"color": "black",
"type": "station",
"registration": new Date('2018-03-03'),
"capacity": 9
}
]
const s = new Set()
cars.forEach((element) => {
console.log(element.id)
console.log(s.has(element.code) ? 0 : element.code)
s.add(element.code)
console.log(element.color)
console.log(element.type)
console.log(element.capacity)
});
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us