/** * Removes all xml entities from a string * and convert them to html entities first * and remove all html entities afterwards. * * <code> * * echo str::unxml('some <em>über</em> crazy stuff'); * // output: some über crazy stuff * * </code> * * @param string $string * @return string */ public static function unxml($string) { return xml::decode($string); }
public function testEncodeDecode() { $expected = 'Süper Önencœded ßtring'; $this->assertEquals($expected, xml::encode($this->string)); $this->assertEquals($this->string, xml::decode($expected)); }