Php

How to install composer

Composer is a tool for dependency management in PHP. It allows you to declare the libraries your project depends on and it will manage (install/update) them for you. Windows Installer The instal [...]

How to create a virtual host

There are two ways you can create your virtual hosts easily. Through command prompt using ssh If you have already installed the vagrant box, then open your bash command window or putty type [...]

Laravel PHPArtisan Commands

Usage: php artisan <command name> Available commands: clear-compiled Remove the compiled class file down Put the application into maintenance mode env [...]

DID you see wpupdatestream user in your wp_users table

If yes, then this is a virus. Please follow the below steps. Delete the user as soon as possible. [code lang="sql"]delete from wp_users where ID=9192191 Delete from usermeta table [code lang=" [...]

Create an array of elements from text between # tag

preg_match_all('/#(.*?)\#/s', $text, $matches); print_r($matches); Ex: janaki #ranjan# mahapatra #my name# Output: array[0=>ranjan,1=>myname]; [...]

How to Reset PHP Array Index

To reset array index we can use the function array_values(). Example: $a = array( 3 => "Apple", 7 => "Mango", 45 => "Orange" ); $b = array_values($a); print_r($b); A [...]

WordPress getting injected with unknown script after body tag

Here is the example of script virus. It added a different type of links after the body tag. Also added a java script just before the closing </head> tag. [caption id="attachment_678" align="a [...]

Enable Mcrypt on PHP Install in Appserv

Please follow the below steps: Add libmcrypt.dll to the System32 folder Uncommnte the include_path var in php.ini Restart Apache [...]

Sorting Multi-Dimensional Arrays in PHP

Example: <?php   $users = array();   $users[] = array('username' => 'shiflett', 'name' => 'Chris Shiflett'); $users[] = array('username' => 'dotjay', 'name' => 'Jon Gibbins'); [...]

Bubblrsort in PHP

The follwoing function has two arguments one is array and other is 0 for ascending sort and 1 is for descending sort. <?php function BubbleSort($sort_array,$reverse) { for ($i = 0; $i < s [...]