Skip to content

Instantly share code, notes, and snippets.

@CTimmerman
Created January 29, 2015 10:58
Show Gist options
  • Select an option

  • Save CTimmerman/4959e97a8b102f1e8d4e to your computer and use it in GitHub Desktop.

Select an option

Save CTimmerman/4959e97a8b102f1e8d4e to your computer and use it in GitHub Desktop.
PHP linking snippet
substr(preg_replace_callback('/(.*?), /', function($matches){
return '<a href="user_mod.php?frole='.rawurlencode($matches[1]).'">'.$matches[1].'</a>, ';
}, $row['froles'].', '), 0, -2)
@CTimmerman

Copy link
Copy Markdown
Author

This turns CSV into linked CSV.

@CTimmerman

Copy link
Copy Markdown
Author

In this case the CSV have already been HTML escaped.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment