chamar função javascript em php code example

Example 1: php dar echo em um stdClass

<?php
$obj = (object) array('1' => 'foo');
var_dump(isset($obj->{'1'})); // outputs 'bool(true)' as of PHP 7.2.0; 'bool(false)' previously
var_dump(key($obj)); // outputs 'string(1) "1"' as of PHP 7.2.0; 'int(1)' previously
?>

Example 2: listar objetos javascript

libros = ["Brideshead", "Faustus", "Musica"]

function libro(titulo, autor, ISBN) {

    this.titulo = titulo;
    this.autor = autor;
    this.ISBN = ISBN;
    //this.isbn calculo
}

var Brideshead  =  new libro("Retorno a Brideshead", "Evelyn Waugh", 8447308472);
var Faustus = new libro("Doctor Faustus", "Thomas Mann", 9788435018449);
var  Musica = new libro("Una música constante", "Vikram Seth", 9780767904643)
console.log(Object.values(Brideshead))

Tags:

Php Example