Reverse String Using PHP

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

Create Web Service With PHP, JSON and MySql

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

PHP Abstract Class and Interface

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

PHP Regular Expressions

  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

PHP Operator

  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

PHP Exceptions

  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