Parse error: syntax error, unexpected ‘echo’ (T_ECHO) in C:\xampp\htdocs\AttendanceSystem\resources\php\method.php on line 250 [closed]

You don’t need to echo it. You can just add it to the string since we’re in PHP at that point:

'<span style="font-size: 16px;">' . esc_html( $student_name ) . '</span></span></p>'

You should also escape any variables you’re adding to HTML strings using esc_html() in case the strings contain HTML tags not just plain text.