All pastes #1560429 Raw Edit

get rid of illegal SGML chars

public php v1 · immutable
#1560429 ·published 2009-09-09 22:40 UTC
rendered paste body
<?php$title = "Autobus zamiast \x1EHetmana\x1D";$replaceArray = array(array(), array()); // this is a replace array for illegal SGML characters;for ($i=0; $i<32; $i++)                  // produces a correct XML output{	$replaceArray[0][] = chr($i);	$replaceArray[1][] = "";}for ($i=127; $i<160; $i++){	$replaceArray[0][] = chr($i);	$replaceArray[1][] = "";}$title = str_replace($replaceArray[0], $replaceArray[1], $title); // get rid of illegal SGML charsecho $title; // prints out "Autobus zamiast Hetmana"?>