Answers for "assign value to new property php"

PHP
1

php assign value to object

// $object->property = 'value';

// assigning a string
$person->first_name = 'John';
$person->last_name = "Doe";

// assigning a number - notice we don't have quotes around 32
$person->age = 32;
Posted by: Guest on January-05-2021

Code answers related to "assign value to new property php"

Browse Popular Code Answers by Language