Skip to content

Instantly share code, notes, and snippets.

View JulianLaval's full-sized avatar
🎯
Focusing

Julian Laval JulianLaval

🎯
Focusing
View GitHub Profile

Keybase proof

I hereby claim:

  • I am julianlaval on github.
  • I am julianlaval (https://keybase.io/julianlaval) on keybase.
  • I have a public key whose fingerprint is FD28 8B81 0C61 FDC7 933C 32D2 5EB9 A3EA C31D 3090

To claim this, I am signing this object:

@JulianLaval
JulianLaval / gist:6448711
Created September 5, 2013 10:59
Simple function to parse inline Markdown links to HTML.
<?php
// PARSE INLINE MARKDOWN LINKS
function markdown_links($x) {
preg_match_all('/\[(.*?)\]\((.*?)\)/', $x, $matches);
if(!empty($matches)){
foreach($matches[0] as $key => $match){
$x_replace = '<a href="'.$matches[2][$key].'" target="_blank">'.$matches[1][$key].'</a>';
$x = str_replace($matches[0][$key], $x_replace, $x);
}