Hashing Algorithms
The hashing algorithms supported by PHP can be found by using the hash_algos() as shown in the below code: The results are shown below:
The hashing algorithms supported by PHP can be found by using the hash_algos() as shown in the below code: The results are shown below:
A transaction is an indivisible unit of work. That said, a transaction cannot be divided or separated. In databases, a transaction involves multiple queries that require successful execution. If successfully executed, the transaction is committed. If one of the queries fails to execute, a rollback should be used for the entire transaction or parts of…
The following are common methods used to fetch data from a database using MySQLi. mysqli_stmt_fetch() Fetch results from a prepared statement into the bound variables. mysqli_fetch_all() Fetches all result rows and returns the result set as an associative array, a numeric array, or both. Available only with mysqlnd. mysqli_fetch_array()Fetch a result row as an associative, a…
When we look at abstract classes, we need to focus on the “abstract methods” within the abstract class. In fact, the rule #1 when dealing with abstraction is: if we create an abstract method in any class, we must make the entire class abstract. This clearly shows the importance of abstract classes comes from its…
PHP allows including files in a very easy way. This is very useful when dealing with multiple classes. The spl_autoload_register(function) registers a function with the Standard PHP Library (SPL) __autoload queue. If the queue is not yet activated it will be activated. The function is a user defined function as seen in the example below.…
unset() unset() destroys the specified variables. The behavior of unset() inside of a function can vary depending on what type of variable you are attempting to destroy. If a globalized variable is unset() inside of a function, only the local variable is destroyed. The variable in the calling environment will retain the same value as before unset() was called.
Cross-site request forgery (CSRF), also known as one-click attack or session riding, is a type of malicious exploit of a website where unauthorized commands are submitted from a trusted website user. Laravel makes it easy to protect your application from CSRF attacks by inspecting every incoming POST, PUT, PATCH, or DELETE for a secret session…
Route::get($uri, $callback); Route::post($uri, $callback); Route::put($uri, $callback); Route::patch($uri, $callback); Route::delete($uri, $callback); Route::options($uri, $callback);
app_path() base_path() config_path() database_path() public_path() resource_path() storage_path()
<?php use Illuminate\Support\Str; //FLUENT STRINGS //after //returns everything after the given value in a string echo “<br>”.Str::of(‘My name is Rabie Akela’)->after(‘My name is’); //Rabie Akela //afterlast //returns everything after the last occurrence of the given value in a string echo “<br>”.Str::of(‘App\Http\Controllers\Controller’)->afterLast(‘\\’); //Controller //append //appends the given values to the string echo “<br>”.Str::of(‘Rabie’)->append(‘ Akela’); //Rabie Akela…