tags:

views:

77

answers:

3

In html source
\xE6\x82\xA0
result is "\xE6\x82\xA0"

but in php
<?php echo "\xE6\x82\xA0"; ?>
result is "悠" (character for \xE6\x82\xA0 )

what can be done to make php echo \xE6\x82\xA0?

+4  A: 

If you want to print the actual string \xE6\x82\xA0, simply replace the double quotes with single quotes. Strings in single quotes are not parsed for escape sequences.

<?php echo '\xE6\x82\xA0'; ?>
Casey Hope
+1  A: 

Try escaping your slashes.

<?php echo "\\xE6\\x82\\xA0"; ?>

or simply use single quotes instead of double quotes

<?php echo '\xE6\x82\xA0'; ?>

or you can simply output directly

?>\xE6\x82\xA0<?php
thephpdeveloper
A: 

Escape the slash characters.

<?php echo "\\xE6\\x82\\xA0"; ?>

Or write the string directly in template mode.

?>\xE6\x82\xA0<?php
David Dorward