PHP 101: Creating an Object from a String

Опубликовано: 14 Февраль 2025
на канале: WebDev Dave
89
1

What's going on YouTube?

In this video, we will create an object using a string. The way this work is that when we use the statement:

new $classname();

It will send a command to the PHP Interpreter to create a new object from a class name that matches the value of $classname. Pretty neat stuff!