$name = "John"; echo "My name is " . $name;
$colors = array("red", "green", "blue");
$age = 22; if ($age >= 18) { $status = "Adult"; } else { $status = "Minor"; }In this example, we assign the value "Adult" or "Minor" to the variable $status based on the condition of whether the age is greater than or equal to 18. Package library: PHP Core assign is a built-in feature in PHP, therefore it does not belong to any package library.