function generateRandomString($length = 10) {
$characters = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
$charactersLength = strlen($characters);
$randomString = '';
for ($i = 0; $i < $length; $i++) {
$randomString .= $characters[rand(0, $charactersLength - 1)];
}
return $randomString;
} Output the random string with the call below:
// Echo the random string. // Optionally, you can give it a desired string length. echo generateRandomString();
Other than caching every hour, or every week, you may cache according to file data.…
To get host url of current server simply replace application\config\config.php [crayon-692bd8339a576123553346/] with [crayon-692bd8339a57b700877029/]
You should first test the existence of a file by file_exists(). [crayon-692bd8339a68f539876942/] or simple solution…
Note: from WordPress Use it like this: [crayon-692bd8339a7a9615663235/] Code: [crayon-692bd8339a7ad107497760/]
[crayon-692bd8339aaa3558083930/] or [crayon-692bd8339aaa8779187935/]