Would anyone be so kind as to convert the following js to php? I use the script and wrap text with a class to use this, but I'd like to use the proper bbcode functionality. TIA
JavaScript:
function memeify(str, base = 3){ //str is the string to memeify, base is the number we use to randomly change the casing of the letter
str = str.split('').map(function(x){ //split the string into an array. then map
let random = Math.floor(Math.random()*100);
//If the random integer is perfectly divisible by our base
if(random % base == 0){
//Change our value to uppercase
return x.toUpperCase();
}
else{
//Other wise it stays lower
return x.toLowerCase();
}
}).join(''); // Join the string back together
return str; // return it
}