The simple concept to find fibonacci series is; add two previous term and get next term. Example of Fibonacci Series is; 0 1 1 2 3 5. Following is a program in PHP to print Fibonacci series . 0, 1, 1, 2, 3, 5, 8, 13, 21, 34 <?PHP $first = 0; $second = 1; … Continue reading Fibonacci series
Category: Core PHP
Core PHP is a simple, bare-bones PHP programming language. It can be used to create web applications.
What is PHP Session? $_SESSION is a special array used to store information across the page requests a user makes during his visit to your website or web application. Although you can store data using cookies but it has some security issues. Since cookies are stored on user's computer it is possible for an attacker … Continue reading PHP Sessions
A string can be reversed either using strrev() function or simple PHP code. For example, on reversing JAVATPOINT it will become TNIOPTAVAJ. Logic: Assign the string to a variable. Calculate length of the string. Declare variable to hold reverse string. Run for loop. Concatenate string inside for loop. Display reversed string. Example: <?php $string = "JAVATPOINT"; $length = strlen($string); … Continue reading Reverse String Using PHP
The factorial of a number n is defined by the product of all the digits from 1 to n (including 1 and n). For example, 4! = 4*3*2*1 = 24 6! = 6*5*4*3*2*1 = 720 Note: It is denoted by n! and is calculated only for positive integers. Factorial of 0 is always 1. The simplest way to find the factorial of a … Continue reading Factorial Using PHP
Web services ( application services ) is one of the most important part of today development where we centralized or data and allow user to access that data from different sources like web, software, app etc.. Web service provide Interoperability between two different language. Web service are easy to understand or to made we can easily create … Continue reading Create Web Service With PHP, JSON and MySql
Abstract class Abstraction is a way of hiding information . In abstraction there should be at least one method which must be declared but not defined. The class that inherit this abstract class need to define that method. There must be a abstract keyword that must be return before this class for it to be … Continue reading PHP Abstract Class and Interface
What is Cookies? A cookie is a small text file that the server embeds on the user's computer. Each time the same computer requests a page with a browser, the cookie is sent back to the server too. Cookies are used to store information about user, visited pages, poll results and etc. The main … Continue reading PHP Cookies
What is Regular Expressions? Regular expressions are a powerful tool for examining and modifying text. Regular expressions themselves, with a general pattern notation almost like a mini programming language, allow you to describe and parse text. They enable you to search for patterns within a string, extracting matches flexibly and precisely. They are also … Continue reading PHP Regular Expressions
What is Operators in PHP Operators let you do various operations like adding two numbers, joining two strings, comparing two values etc. There are two types of operators as binary and unary. Binary needs two operands to do the operation while unary requires only one. Assignment Operator Assignment operator is so common in PHP … Continue reading PHP Operator
Whats is Exception: Exceptions give us much better handling of errors an allow us to customize the behavior of our scripts when an error (Exception) is encountered. Previously PHP dealt with errors by having error flags from functions and the trigger_error() function. These were well and good for pre-php5 days but in the new … Continue reading PHP Exceptions