Skip to content

Instantly share code, notes, and snippets.

@CTimmerman
Created January 29, 2015 10:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save CTimmerman/4959e97a8b102f1e8d4e to your computer and use it in GitHub Desktop.
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
Author

This turns CSV into linked CSV.

@CTimmerman
Copy link
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