How to get logged in username?

Please help. It says "

This page isn’t working

mywebsite is currently unable to handle this request.

HTTP ERROR 500

"

Here is my code.

 

<?php

include 'engine/lib/sessions.php';
$user_guid = elgg_get_logged_in_user_guid();
echo $user_guid;


?>

Beginning Developers

Beginning Developers

This space is for newcomers, who wish to build a new plugin or to customize an existing one to their liking