Jump to content

Converting Javascript RegExp to a php function


ksye1773

Can some one convert the following javascript function to PHP  

  1. 1. Can some one convert the following javascript function to PHP

    • Asap
      0
    • Test
      0


Recommended Posts

function HTMLSafeToUnicode(line, ishex)

{

var re = new RegExp('&#([0-9A-Fa-f]{2,4});');

var m  = re.exec(line);

while (m != null)

{

var re2 = new RegExp('&#'+m[1]+';','g');

line = line.replace(re2, String.fromCharCode(ishex==true?h2d(m[1]):m[1]));

m  = re.exec(line);

}

 

return line;

}

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.