Posts
Showing posts with the label PHP
Display MySQL data using PHP in Browser
- Get link
- X
- Other Apps
Code for fetching data from MySQL database using PHP API in Browser :- ############################################################################ <!DOCTYPE html> <html> <head> <title> PHP-MySQL Tutorials </title> <!-- Here I'm using CSS Framework Bootstrap for Screen design. Below Code from <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous"> is for CDN link to get content from internet. --> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous"> <!-- Customized css --> <style type="text/css"> body {...
Strings in PHP, String Functions & Operations on Strings.
- Get link
- X
- Other Apps
String : String is a sequence of Characters. Strings Functions: 1. strlen(); --Returns the length of the String. Strlen() Function source code Length of "Hello World!". 2. strpos(); --Return the position of Substring or Second string in First String else return false. strpos() string position function output of the function 3. strrev(); --Reverse the entered String. Reverse the string strrev() source code Output of original string along with revered string 4. str_word_count(); --Return the Worlds in String Space Separated. str_word_count() return the output total number of word in string. output of the above code. 5. str_replace(); --Function replace the first parameter,with second from third String. Source Code of str_replace() output of above code. © 2015 Rajendra Kumar Yadav Learn Computer Tricks and Programming & Learn PHP
Install PHP, MySQL, Apache and PHPMYADMIN..
- Get link
- X
- Other Apps
Hello Friends, Before Write a PHP program it is necessary to configure the PHP with any Server like Apache or IIS or any other by using which it may possible to access the page. Today We will see that how to install PHP and Apache.. There are two method to install the web server setup First Method Download the PHP Click Here. Download Apache to Click Here. Now Extract these .zip files and place in the C:/Apache and Configure Environment Variable. Second Method Download XAMPP (consist of Apache, MySQL, PHP, PHPMyAdmin). Click Here. Download WAMP (Windows Apache, MySQL, PHP). Click Here According to me XAMPP is best because it consist with a...
Assignment 1 Question 2 (Server Side Scripting Part using PHP).
- Get link
- X
- Other Apps
<?php /* @autor Rajendra Kumar Yadav @Check the Substring position @Check First and last occurance Position @ Replace Small Substring with some new substring. */ $n=$_POST['str1']; $n1=$_POST['str2']; $n2=$_POST['str3']; $ch=$_POST['ch']; function POSITION($n,$n1) { $c=strpos($n,$n1); $c1=strrpos($n,$n1); echo "The Substring 2 Occurs at position ".$c." and ".$c1; } function OCCUR_SUBSTR($n,$n1) { $c2=substr_count($n,$n1); echo "The Substring ".$n1 ." occured ".$c2." times."; } if($ch=="first_last_pos") { POSITION($n,$n1); } if($ch=="occ_substring") { OCCUR_SUBSTR($n,$n1); } function REPLACER($n,$n1,$n2) { $c3=strlen($n1); $c4=substr_replace($n,$n2,$c,$c3); echo "First String is ".$n; echo "Second String is ".$n1; echo "New String is ".$n2; } if($ch==...