Skip to content

Instantly share code, notes, and snippets.

@sbellver
Last active August 29, 2015 14:08
Show Gist options
  • Save sbellver/570f810702ca0af7d6b9 to your computer and use it in GitHub Desktop.
Save sbellver/570f810702ca0af7d6b9 to your computer and use it in GitHub Desktop.
Limpia caracteres para pasar de postgres a mysql
<html>
<head>
<title>Limpia los insert para pasar de Postgres a Mysql</title>
<meta charset="UTF-8">
</head>
<body>
<?
$str = "Cadena de Insert a cambiar";
$str = str_replace("\xe2\x80\x8b", '', $str);
$str = str_replace("\xCC\x81n", '', $str);
$str = str_replace("\xCC\x81s", '', $str);
$str = str_replace("\xCC\x81", '', $str);
$str = str_replace("'t'", '1', $str);
$str = str_replace("'f'", '0', $str);
echo $str;
?>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment