Skip to content

Instantly share code, notes, and snippets.

/file1.php Secret

Created December 13, 2016 00:02
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 anonymous/c5efda1c553059813b107262595f9572 to your computer and use it in GitHub Desktop.
Save anonymous/c5efda1c553059813b107262595f9572 to your computer and use it in GitHub Desktop.
*/ NOT WORKING /*
public static function prepare_strings_for_mysql_in_statement( $strings ) {
$wrapped = array();
foreach( $strings as $string ) {
$wrapped[] = sprintf( '"%s"', $string );
}
return implode( ', ', $wrapped );
}
*/ WORKING /*
public static function prepare_strings_for_mysql_in_statement( $strings ) {
$wrapped = array();
foreach( $strings as $string ) {
$wrapped = sprintf( '"%s"', $string );
}
return implode( ', ', $wrapped );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment