Posts by Rodrigo Carneiro • 12 points
2 posts
-
-3
votes1
answer123
viewsA: Generate a string with random letters and numbers in PHP (UUID)
Assuming you want to generate a UUID, this code only works in PHP 7 or higher random_bytes - Generates cryptographically secure pseudo-random bytes function uuid(){ $data = random_bytes(16);…
phpanswered Rodrigo Carneiro 12 -
0
votes2
answers45
viewsA: Deleting files from a PHP directory
Checks whether the $file is coming correctly with the file name and makes a if: if ('zVazio.jpg' === $file) { unlink($file); } If you are unsure of the file name/path, you can try using strpos to…