Syntax error

How to write something that would work?

   <p class="p_teacher_reg">:</p><?php echo "<p class='p'> "."  "$_SESSION['name']" "." "$_SESSION['surnamet']" "." "$_SESSION['last_name']"</p>"; ?>

Answer 1

If short recording is enabled, it’s better to write like this

<p class="p_teacher_reg">:</p>
 <p class="p">
    <?=$_SESSION['name']?> <?=$_SESSION['surnamet']?> <?=$_SESSION['last_name']?>
 </p>

If not…

<p class="p_teacher_reg">:</p>
 <p class="p">
     <?php echo $_SESSION['name'] .' '. $_SESSION['surnamet'] . ' ' . $_SESSION['last_name'];?>
  </p>

Answer 2

<p class="p_teacher_reg">:</p><?php echo "<p class='p'> ".$_SESSION['name']." ".$_SESSION['surnamet']." ".$_SESSION['last_name']."</p>"; ?>

well, you can.