Postingan

Menampilkan postingan dengan label php

Contekan Random String menggunakan PHP

 Berikut merupakan contekan script fungsi untuk random string di PHP. function randomString ( $length = 10 ) { $characters = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ' ; $charactersLength = strlen ( $characters ); $randomString = '' ; for ( $i = 0 ; $i < $length ; $i ++) { $randomString .= $characters [ random_int ( 0 , $charactersLength - 1 )]; } return $randomString ; }

Contekan .htaccess Codeigniter hilangin index.php

Cuma contekan .htaccess codeigniter untuk hilangin index.php diletakkan di root project codeigniter dengan nama file .htaccess <IfModule mod_rewrite.c> Options -Indexes <IfModule mod_negotiation.c> Options -MultiViews </IfModule> RewriteEngine On # Redirect Trailing Slashes If Not A Folder... RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)/$ /$ 1 [L,R= 301 ] # Handle Front Controller... RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^ index.php [L] </IfModule> Maapin cuma dikit, namanya juga contekan