protected function getUserAgentLines(&$robots_txt_content, $user_agent_string)
  {
    // Split the content into its lines
    $robotstxt_lines = explode("\n", $robots_txt_content);
    
    $user_agent_lines = array();
    $current_user_agent = null;
    
    // Loop over the lines and check if any user-agent-sections match with our agent
    $cnt = count($robotstxt_lines);
    for ($x=0; $x<$cnt; $x++)
    {
      $line = trim($robotstxt_lines[$x]);
      
      if ($line == "") continue;
      
      // Check if a line begins with "User-agent"
      if (preg_match("#^User-agent:\s*(.*)# i", $line, $match))
      {
        if (isset($match[1]))
          $current_user_agent = trim($match[1]);
        else
          $current_user_agent = "";
        
        continue;
      }
      
      // If User-Agent matches with our user-agent-string
      if ($current_user_agent == "*" || strtolower($current_user_agent) == strtolower($user_agent_string))
      {
        $user_agent_lines[] = trim($line);
      }
    }
    
    return $user_agent_lines;
  }