Skip to content

Latest commit

 

History

History
16 lines (13 loc) · 367 Bytes

README.md

File metadata and controls

16 lines (13 loc) · 367 Bytes

Usage

$obj = new JSBeautify('function escapeHtml(string){return String(string).replace(/[&<>"'`=\/]/g,function fromEntityMap(s){return entityMap[s]})}');
echo $obj->getResult();

the output will be

function escapeHtml(string) {
    return String(string).replace(/[&<>"'`=\/]/g, function fromEntityMap(s) {
        return entityMap[s]
    })
}