StepsEasy
PHP Variables - Example
Run
Reset
Destroy & Close
← Back to lesson
Code Editor
php
<?php $name = "Alice"; $age = 25; $isStudent = true; $height = 5.6; $colors = ["red", "green", "blue"]; echo "Name: $name\n"; echo "Age: $age\n"; echo "Is Student: " . ($isStudent ? 'Yes' : 'No') . "\n"; echo "Favorite color: " . $colors[0]; ?>
Result
Click "Run" to execute the code...
Loading runtime...
Ready
PHP | In-Browser Execution