Send to a Friend

Vincentt's avatar

How can I create a special character in PHP from a variable?

Asked by Vincentt (8094points) November 16th, 2007

Hi,

In PHP, if I have

$var = ‘AA’;

I want to be able to achieve the same result as I would have when doing

echo ”\xAA”;

Which would output ª
I tried doing

echo ”\x$var”;

But that only literally outputted the string (\xAA), instead of ª what I wanted. Any ideas how I can do it?

Thanks.

Using Fluther

or

Using Email

Separate multiple emails with commas.
We’ll only use these emails for this message.