Cloud_Geek Posted March 25, 2021 Share Posted March 25, 2021 I am new to php. Can somebody guide what's the error in below code? <?php echo "Red"; echo "Blue"; echo "Green" ?> Quote Link to comment https://forums.phpfreaks.com/topic/312380-can-someone-guide-whats-the-error-in-this-code/ Share on other sites More sharing options...
Barand Posted March 25, 2021 Share Posted March 25, 2021 What are you expecting the code to do? Why do think there is an error? Quote Link to comment https://forums.phpfreaks.com/topic/312380-can-someone-guide-whats-the-error-in-this-code/#findComment-1585374 Share on other sites More sharing options...
Cloud_Geek Posted March 26, 2021 Author Share Posted March 26, 2021 22 hours ago, Barand said: What are you expecting the code to do? Why do think there is an error? I want to display these color names but its giving error. Quote Link to comment https://forums.phpfreaks.com/topic/312380-can-someone-guide-whats-the-error-in-this-code/#findComment-1585403 Share on other sites More sharing options...
Barand Posted March 26, 2021 Share Posted March 26, 2021 (edited) What error is it giving? Care to share? When I run your code it outputs Quote RedBlueGreen Edited March 26, 2021 by Barand Quote Link to comment https://forums.phpfreaks.com/topic/312380-can-someone-guide-whats-the-error-in-this-code/#findComment-1585406 Share on other sites More sharing options...
cyberRobot Posted May 6, 2021 Share Posted May 6, 2021 On 3/26/2021 at 6:59 AM, Cloud_Geek said: I want to display these color names but its giving error. As Barand mentioned, the code (as posted) is technically fine. Just be aware that the missing semi-colon after the line that outputs "Green" may cause errors if you add more code to the PHP block after the final echo statement. Quote Link to comment https://forums.phpfreaks.com/topic/312380-can-someone-guide-whats-the-error-in-this-code/#findComment-1586358 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.