I want to display a list of names and separate them with a comma and the last name should be separated with an "and" using php. Please I need help.
Here is my code:
<?php
$bdaypersoname="";
do {
$bdaypersoname .= $row_Recordset2['Name']." , ";
} while ($row_Recordset2 = mysql_fetch_assoc($Recordset2));
$bdaypersoname= rtrim($bdaypersoname, " , ");
echo $bdaypersoname;
?>
</p>