The Situation:
I've got a simple query that I'm trying to echo over and over again within a single page (username if chosen or first and last name as else).
I've tried working with strings and functions to no avail when it comes to outputting them more than once. To save on the coding and size of the file, I'd love to do this function once and then just echo the function where is needed.
Here's my if/then statement that I'd like to make into a repeatable function:
Code: Select all
<?php
if($row_rsUserDetails['use_username'] == 1)
{
echo $row_rsUserDetails['Username'];
}
else
{
echo $row_rsUserDetails['f_name'];
echo " ";
echo $row_rsUserDetails['l_name'];
}
?>