Blogs On php

About php

PHP is one of the most popular server-side scripting and HTML embedded languages which is designed primarily for web development but also used as a general-purpose programming language. HTML embedded means that you can use PHP statements within an HTML code. The best things in using PHP are that it is extremely simple for a newcomer, but offers many advanced features for a professional programmer. PHP scripts can only be interpreted on a server that has PHP installed. PHP code may be embedded into HTML code.

Explode string by last occurrence and get first part

Explode and Implode string in php

Some of the cases we need to split any string or it may be my URL to split. Now I am explaining to you, how to explode the string by the last occurrence at getting the first part of the string in a si...

How do you Encrypt and Decrypt a PHP String

MCrypt encription in php

What is Mcrypt in PHP? Mcrypt is a replacement for the popular Unix crypt command. the crypt was a file encryption tool that used an algorithm very close to the World War II Enigma cipher. Mcrypt pro...

How to find prefix and suffix of the word in javascript

Find start and end position of selected text

First of all, you have to know that how to get the currently selected text on the page by using the JavaScript. So, Javascript provided a method for retrieving the current selection of the page by usi...

How to find minimum value of an array

Minimum value of an array using foreach loop

It's very simple to find the minimum value of an array using foreach loop. Create an array with some numeric value. Now create a temporary variable $temp in which stored array’s first index&rsqu...


Find the Largest Number in an Array using php

Example  for getting largest number in an array

Example  for getting largest number in an array: $array = array(20,18,95,45,48); $max1 = 0; $max2 = 0; for($i=0; $i<count($array); $i++) { if($array[$i] > $max1) { ...

Call by reference in php with example

Reference variable in php with example

Let's understand the concept of call by reference by the help of examples. Variable $str is passed to the adder function where it is concatenated with 'Call By Reference' string. Here, printing $str v...

Switch statement in php

Switch case in php with multiple case example

Switch statement is used to execute one statement from multiple conditions in PHP. It works like PHP if-else-if statement. But it's better that if-else-if statement. Syntax for Switch statement in ph...

How to secure input in php

php sanitize form input

Sanitizing data means Remove any illegal character from the data.  In php you need to impliment this one for secure input for MySQL. This one also help to know you about your question - How...


Top