title: How to get the scheme when no http:// or https:// is being specified?
body: <p>I would like for users to be able to enter their company website URL in their company setup dialog, but I need to validate that. Apart from the typical sanitization functions, I would like to check if the URL scheme is <code>http://</code> or <code>https://</code> without the assumption the user has already entered it.</p>
  
  <p>My function already parses the entered url to detect the scheme with a regex, but I would like to (ideally) check the URL from the server ala file_get_contents or parse_url and get the scheme, but I don't know how could I do it.</p>