/** * Removes a BOM from a string. * * @param string $str The UTF-8 encoded string * @return string The string without a BOM */ function utf8_remove_bom($str) { return utf8_check_bom($str) ? substr($str, 3) : $str; }
/** * @dataProvider providerUtf8CheckBom */ public function testUtf8CheckBom($str, $rv) { $this->assertEquals(utf8_check_bom($str), $rv); }