daily pastebin goal
25%
SHARE
TWEET

Untitled

a guest Oct 21st, 2018 61 Never
Upgrade to PRO!
ENDING IN00days00hours00mins00secs
  1. <?php
  2.  
  3. $str = "SQL :param1 :param2 END_SQL";
  4. $params = array (
  5.   'param1' => 'param1 value',
  6.   'param2' => 'param2 value'
  7. );
  8.  
  9. echo preg_replace_callback('/:([a-z0-9]+)/', function ($m) use ($params) {
  10.   return '\'' . mysql_escape_string($params[$m[1]]) . '\'';
  11. }, $str) . "\n";
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top