# Converting to PHP

**URL:** <https://forum.kirupa.com/t/converting-to-php/283535>\
**Category:** Uncategorized\
**Created:** [March 7, 2009, 5:43pm UTC](https://forum.kirupa.com/t/converting-to-php/283535 "2009-03-07T17:43:47Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![spam\_killer](https://avatars.discourse-cdn.com/v4/letter/s/b2d939/32.png) [@spam\_killer](https://forum.kirupa.com/u/spam_killer)\
**Post date:** [March 7, 2009, 5:43pm UTC](https://forum.kirupa.com/t/converting-to-php/283535/1 "2009-03-07T17:43:47Z")

</div>

Expert please help me…

I goggling just came out with simple explanation and no answer at all.

Here I have JavaScript code and I wish to convert it into PHP style…

```auto
var Vble = '5';
var Hg = Vble.charCodeAt(0)^2;
var writeIn = String.fromCharCode(Hg);
document.write(writeIn);

```

when execute, the result = 7. I try convert it into PHP using ord() and chr() but the output not the same…why? Suggestion please…!! thanks
