Skip to content

Instantly share code, notes, and snippets.

@vdeville
Created August 23, 2016 14:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save vdeville/8f121e0742caedc05058c3ed9c6d6ac4 to your computer and use it in GitHub Desktop.
Save vdeville/8f121e0742caedc05058c3ed9c6d6ac4 to your computer and use it in GitHub Desktop.
if ($length != '' && ! preg_match($pattern, $type)) {
$lengthFix = str_replace(",", ".", $length);
if($lengthFix != $length){
$modified = true;
}
if(is_numeric($lengthFix)){
if($modified){
$length = str_replace(".", ",", $lengthFix);
}
$query .= '(' . $length . ')';
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment