0

I am trying to echo two predefined variables, on the same line, with a space in between them. I am also hoping to use either ucfirst or ucwords to capitalize the first letter of each word. But to my understanding these only work with a string.

Here is the code I have:

<?php if(isset($_SESSION['uname'])){
		  echo ucwords$_SESSION['fname'] $_SESSION['lname'];
		  }?>

I can get it to work with one variable using:

echo ucfirst($_SESSION['fname']);

But I am not sure how to incorporate the second variable into the string and get the results I want. Will someone please help?

2
Contributors
2
Replies
3
Views
8 Years
Discussion Span
Last Post by Tekkno
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.