Advertisement
bueddl

Untitled

Sep 29th, 2013
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.36 KB | None | 0 0
  1.  
  2.         foreach ($data as $key => $value)
  3.         {
  4.             /* Secure that variables are valid for php */
  5.             if (! preg_match('/[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/ims', $key) )
  6.                 continue;
  7.  
  8.             /* Add a new line to the template code */
  9.             $template_code .=
  10.                 /* Write varaible name */
  11.                 '$' . $key . ' = ' . $this->phpize_var($value, true) . ';' . "\n";
  12.  
  13.         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement