<?php
/**
* Decode a string with encoded characters like &
* @param string encodedString - string to encode
* @return string
*/
function decodeEntities(encodedString) {
var textArea = document.createElement('textarea');
textArea.innerHTML = encodedString;
return textArea.value;
}
console.log(decodeEntities("Keith & Hards"));
output: "Keith & Hards"
No comments:
Post a Comment