How do I check if $couse_sections->name is NULL then echo $course_sections->seciton and if not NULL then echo $course_sections->name
if (isset( $couse_sections->name )) {
echo"$thissection->name";
}
else {
echo"<h3>Topic $thissection->section</h3>";
}
CodePudding user response:
echo $course_sections->name ?? $course_sections->section;