PHP PHP Basics Daily Exercise Program String Manipulation

Jeff Jones
Jeff Jones
1,424 Points

Stuck on PHP Question

I am taking a quiz and I have no idea what to do. Here is the question:

1) Use the $fullName variable

2) Display the following string to the screen.

Rasmus Lerdorf was the original creator of PHP.

3) Use an escape character to add a newline to the end of the string.

Here is my code:

<?php

//Place your code below this comment

$firstName = "Rasmus"; $lastName = "Lerdorf"; $fullName = $firstName . " " . $lastName "was the orignal creator of PHP";

?>

Would you mind helping me? Answers in code are best.

Thanks!

index.php
<?php

//Place your code below this comment

?>

3 Answers

Frederik Hulleman
Frederik Hulleman
PHP Development Techdegree Graduate 15,149 Points

I think it's much more useful to give you a hint, rather than giving you the code if you don't mind.

3 things I noticed: 1) they ask to display text. what could you use to display the $fullName variable? 2) in your code, to display the sentence, I miss a concatenator 3) you're combining two things in one line of code: creating the fullName variable and displaying the full sentence

I hope this is helpful. If not, let me know!

Cheers!

Jeff Jones
Jeff Jones
1,424 Points

Ok, I got to here:

<?php

//Place your code below this comment $firstName = "Rasmus"; $lastName = "Lerdorf"; $fullName = $firstName . " " . $lastName . " " was the original creator of PHP./n";

?>

Unfortunately, I have a disability and it makes it really hard for me to get through this stuff. I don't know what's not working in the code. I'm wondering if I'm setting up the /n wrong or if it's something else in the way I wrote it.

Anyways, thanks for your help! :)