Skip to content

Instantly share code, notes, and snippets.

@malinky
Created March 3, 2016 09:24
Show Gist options
  • Save malinky/93970f2c64099194dc95 to your computer and use it in GitHub Desktop.
Save malinky/93970f2c64099194dc95 to your computer and use it in GitHub Desktop.
Add // to URL if missing either http:// or https:// (Example using Blade)
<a href="{{ preg_replace('/^(?!https?:\/\/)/', '//', $supplier->website) }}">Website</a>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment