Introduction
PHP is a server scripting language, and It is a powerful tool for making interactive and dynamic Web-pages. I have used WampServer 2.2 for following excercise..
250+ PHP Programs for Practice | PHP Tutorial with Solutions
Write a PHP program to find the Fibonacci series
List of PHP basic programs with examples
List of PHP array programs with examples
All star pattern programs in PHP
All PHP Loop programs with examples
List of String programs with examples
PHP Exercises, Practice, Solution | PHP programming exercises
Write a PHP script to select first 6 words from the following string
Write a PHP script to print letters from ‘a’ to ‘z’.
Write a PHP script to get the first word of a sentence
Write a PHP script to remove comma(s) from the following numeric string
Write a PHP script to remove all leading zeroes from a string
Write a PHP script to insert a string at the specified position in a given string
Write a PHP script to remove a part of a string from the beginning
Write a PHP script to print the next character of a specific character
Write a PHP script to generate simple random password from a given string
Write a PHP script to replace the first ‘the’ of the following string with ‘best’
Write a PHP script to get the last three characters of a string
Write a PHP script to extract the user name from the email ID
Write a PHP script split the following string
Write a PHP script to convert first character of all the words uppercase
Write a PHP script to convert first character uppercase
Write a PHP script to convert uppercase string to lowercase
Write a PHP script to convert lowercase string to uppercase
Write a PHP program to print table of number
Write a PHP Script to sum of odd numbers from 1 to 10
Write a PHP Script to sum of even numbers from 1 to 10
Write a PHP script to print all odd numbers between 1 to 10
Write a PHP script to print all even numbers between 1 to 10
Write a PHP script using nested for loop that creates a chess board
Write a program which will count the “t” characters in the text “techstudy”
Write a PHP script to calculate and print the factorial of a number using a for loop
Write a PHP script using a for loop to add all the integers between 0 and 20 and display the sum
Write a PHP script that displays 1 2 3 4 5 6 7 8 9 10 numbers on one line
Write a PHP function to set union of two arrays
Write a PHP script to sort an array in reverse order (highest to lowest)
Write a PHP function that returns the lowest integer that is not 0
Write a PHP script to generate unique random numbers within a range
PHP count() Function to get Length
Write a PHP script which displays all the numbers between 50 and 150 that are divisible by 4
Write a PHP script to calculate and display average temperature, five lowest and highest temperatures
Write a PHP script that inserts a new item in an array in any position
Write a PHP script to get the First element of the above array
Write a PHP script which will display the Cars in the following way using array
Write a PHP program that multiplies corresponding elements of two given lists
Write a PHP program to print out the multiplication table upto 5*5
Write a PHP program to compute the sum of the prime numbers less than 200
Write a PHP program to remove duplicates from a sorted list
Write a PHP program to convert word to digit
Write a PHP program to check if a number is an Armstrong number or not
Write a PHP program to swap two variables
Write a PHP function to test whether a number is greater than 30, 20 or 10 using ternary operator
Write a PHP script to display string, values within a table
Write a simple PHP program to check that email id is valid or not
Write a PHP script to redirect a user to a different page
Write a PHP script, which changes the color of the first character of a word
Write a simple PHP browser detection script
Write a PHP script to get the client IP address
Create a HTML form that accept the user name and display the name using php
Write a PHP script to display ‘Hello World!’
PHP is a server scripting language, and It is a powerful tool for making interactive and dynamic Web-pages. I have used WampServer 2.2 for following excercise..
<?php
function sum_of_digits($nums) {
$digits_sum = 0;
for ($i = 0; $i < strlen($nums); $i++) {
$digits_sum += $nums[$i];
}
return $digits_sum;
}
echo sum_of_digits("123456789")."<br>";
echo sum_of_digits("999999")."<br>";
?>
Introduction : java final keyword The final keyword present in Java programming language is generally used for restricting the user. …
C++ Memory Management We know that arrays store contiguous and the same type of memory blocks, so memory is allocated …