Skip to content

Instantly share code, notes, and snippets.

@ekyfauzi
Last active April 25, 2020 13:45
Show Gist options
  • Save ekyfauzi/846b41cf1891a061ec96f7470ece03ad to your computer and use it in GitHub Desktop.
Save ekyfauzi/846b41cf1891a061ec96f7470ece03ad to your computer and use it in GitHub Desktop.
<?php
....
$url = parse_url(getenv("DATABASE_URL"));
$host = $url["host"];
$username = $url["user"];
$password = $url["pass"];
$database = substr($url["path"], 1);
...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment