Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Javascript function in PHP fromCharCode()

Tags:

javascript

php

var test = String.fromCharCode(112, 108, 97, 105, 110);
document.write(test);

// Output: plain

Is there any PHP Code to work as String.fromCharCode() of javascript?

like image 465
LIGHT Avatar asked Oct 20 '12 16:10

LIGHT


People also ask

What does fromCharCode do in JavaScript?

fromCharCode() method converts Unicode values to characters. The String. fromCharCode() is a static method of the String object. The syntax is always String.

How does fromCharCode work?

The fromCharCode() method accepts a sequence of Unicode values. These Unicode values are UTF-16 values (16-bit integers between 0 and 65535) that are converted to characters and concatenated together in a string. This resulting string is then returned by the fromCharCode() method.

What is CHR in JS?

Compile and run Constraint Handling Rules (CHR) in JavaScript. CHR. js is a just-in-time (JIT) compiler for Constraint Handling Rules, embedded in JavaScript. For better runtime performance it supports ahead-of-time (AOT) compilation too, either by its command line tool chrjs or babel-plugin-chr, a plugin for Babel.


1 Answers

Try the chr() function:

Returns a one-character string containing the character specified by ascii.

http://php.net/manual/en/function.chr.php

like image 78
techfoobar Avatar answered Sep 26 '22 15:09

techfoobar