Obtener el nombre de la clase de un objeto
Obtener el nombre de la clase de un objeto o instancia creada previamente es muy sencillo en PHP.
PHP dispone de una función: get_class() que devuelve el nombre de la clase de la instancia que se le pase como parámetro.
Ejemplo de aplicación:
$usuario = new Usuario(); $clase = get_class($usuario); //$clase = Usuario
Autor
Escrito por Jose Aguilar - Director ejecutivo y tecnológico en JA Modules. Experto programador PrestaShop y Experto programador WordPress.
Keep posting stuff like this i really like it
hey there and thank you for your info – I’ve certainly picked up anything new from right here. I did however expertise a few technical points using this website, since I experienced to reload the web site lots of times previous to I could get it to load correctly. I had been wondering if your hosting is OK? Not that I’m complaining, but slow loading instances times will very frequently affect your placement in google and can damage your quality score if advertising and marketing with Adwords. Anyway I’m adding this RSS to my email and could look out for much more of your respective intriguing content. Make sure you update this again very soon..