Backreference in PHP
You could do this with views (without PHP), but if you want to use PHP you should check out Entity Field Query

You will have to do something like this:

$query = new EntityFieldQuery();
$query-&gt;entityCondition('entity_type', 'user')
  -&gt;propertyCondition('status', NODE_PUBLISHED)
  -&gt;fieldCondition('your_field_course', 'target_id', $nid, '=')
  -&gt;addMetaData('account', user_load(1)); // Run the query as user 1.
$result = $query-&gt;execute();
if (isset($result['user'])) {
  $uids = array_keys($result['user']);
  $users = entity_load('user', $uids);
}