javascript: remove value fom array
2019-12-31
IN1, 2019-12-31 00:00:00
IN1, 2023-04-10 14:16:30


Q; How to remove a value from a javascript array ?

A: use splice method to cut off value from array

/**
 * remove value fom array
 */
Array.prototype.remove = function(mValue) {

    return this.splice(this.indexOf(mValue), 1);
}

// example array 
var aData = [1, 2, 3, 4, 5];

// usage: remove the value "4"
aData.remove(4);

// gives: [1, 2, 3, 5]
console.log(aData); 
[…]

php: generate a 60 char random string
2019-12-29
IN1, 2019-12-29 00:00:00
IN1, 2023-04-10 14:16:30


Q: how to create a 60 char random string ?

A: use the benath function generateRandomString() to create such a string. Modify to your needs.

usage

$srandomString = enerateRandomString();

it will produce a sting like:
1572437300-71425db97d34ae5da7-37619268-DSCbkJT0JoqHpPtsCiN1l

/**
 * @return string
 */
function generateRandomString()
{
 […]


This website uses Cookies to provide you with the best possible service. Please see our Privacy Policy for more information. Click the check box below to accept cookies. Then confirm with a click on "Save".