Featured Post Today
print this page
Latest Post

Float Different Functions In PHP : 6th Day Lecture : Samee



Float Different Functions In PHP

Sample 1 : Example of Float.

float 3.584

Sample 2 : Different Functions Examples to show Float Values

float 3.684
4
3.68
3
4

 <html>  
   <head>  
     <title><?php $pagetitle="Float Different Functions In PHP : 6th Day Lecture : Samee";  
                          echo $pagetitle; ?></title>  
         <meta name="description" content="<?php $pagetitle ?>" />  
         <meta name="robots" value="nofollow, noindex" />  
     <link rel="icon" type="image/ico" href="http://www.iconarchive.com/download/i50954/deleket/3d-cartoon-vol3/Web-Coding.ico" alt="Icon" />  
     <link type="text/css" href="http://www.getacho.com/download/phpcss/stylesheet.css" rel="stylesheet" />  
   </head>  
   <body>  
        <img id="logo" src="http://icons.iconarchive.com/icons/deleket/3d-cartoon-vol3/256/Web-Coding-icon.png" alt="Coding">  
     <h1 align="center">Float Diffirent Functions In PHP : <a href="http://sameearticles.blogspot.com" target="_blank">Samee Articles</a></h1>  
       <h2 align="left">Sample 1 : Example of Float.</h2>  
         <?php  
                          $float=3.58400;  
                           var_dump($float)  
         ?>  
       <h2 align="left">Sample 2 : Different Functions Examples to show Float Values</h2>  
         <?php  
                          $float=3.684000000;  
                           var_dump($float); //It is to show the value is float  
                           echo round($float) . "<br />"; //it is used to increase the value to 4 as mathematics rules.   
                           echo round($float,2) . "<br />"; //it is used to increase the value after point and 2 digit as mathematics rules.  
                           echo floor($float) . "<br />"; //it is used to increase the value according to complete value  
                           echo ceil($float) . "<br />"; //it is used to increase the value to 4 as mathematics rules.   
         ?>  
   </body>  
 </html>  


0 comments

Define Constants in PHP : 6th Day Lecture : Samee


define php constant

Constants In PHP : Samee Articles

Sample 1 : What is Constant in PHP?

Constant is a identifier for a simple value.
The Value can not be changed during the script.
Value starts with letter or underscore, never with dollar sign "$".
It starts with "define."
Constant is default Case Sensitive.

Sample 2 : Constant Example in PHP

My Name is Samee Ullah Feroz.

Sample 3 : Constant Example in PHP

My Nick Name is Sherri Bhai.

 <html>  
   <head>  
     <title>Constants in PHP : 6th Day Lecture : Samee</title>  
     <link rel="icon" type="image/ico" href="http://www.iconarchive.com/download/i50954/deleket/3d-cartoon-vol3/Web-Coding.ico" alt="Icon" />  
     <link type="text/css" href="http://www.getacho.com/download/phpcss/stylesheet.css" rel="stylesheet" />  
     <meta name="robots" value="nofollow, noindex" />  
   </head>  
   <body>  
        <img id="logo" src="http://icons.iconarchive.com/icons/deleket/3d-cartoon-vol3/256/Web-Coding-icon.png" alt="Coding">  
     <h1 align="center">Constants In PHP : <a href="http://sameearticles.blogspot.com" target="_blank">Samee Articles</a></h1>  
       <h2 align="left">Sample 1 : What is Constant in PHP?</h2>  
         <?php  
                          echo 'Constant is a identifier for a simple value. <br /> The Value can not be changed during the script. <br /> Value starts with letter or underscore, never with dollar sign "$". <br /> It starts with "define." <br /> Contant is defauld Case Sansitive.';  
         ?>  
       <h2 align="left">Sample 2 : Constant Example in PHP</h2>  
         <?php  
                          define("name","My Name is Samee Ullah Feroz."); //here it is case sansitive.   
                          echo name;  
                          /*echo Name;*/ //Here is an error due to case sensitivity  
         ?>  
       <h2 align="left">Sample 3 : Constant Example in PHP</h2>  
         <?php  
                          define("name2","My Nick Name is Sherri Bhai.",true); //here it is not case sensitive.   
                          echo Name2; //Here it is not sensitive due to "true" word  
         ?>  
   </body>  
 </html>  


0 comments

Custom Cascading Style Sheet (CSS) Code With Absolute Background Image Code

Custom Cascading Style Sheet (CSS) Code With Absolute Background Image Code
 @charset "utf-8";  
 /* CSS Document for : SameeArticles.Blogspot.com */  
 #logo  
      {  
           width:200px;  
           height:200px;  
           float:right;  
           background-color:#FFFFFF;  
      }  
 html  
      {  
           height:100%;  
           width:100%;  
           background:url(http://www.southsoft.co.za/images/mysql.jpg) center center no-repeat;  
      }  
 h1  
      {  
           background:#00FF00;  
           border-style:dotted;  
           margin-right:200px;  
      }  
 h2  
      {  
           background:#CCCCCC;  
           font-family:Georgia, "Times New Roman", Times, serif;  
           font-size:16px;  
      }  
 a:link   
      {  
           color:#000000;  
           text-decoration:none;  
      }  



Custom Style Sheet with Absolute Background

For Background Image : You can use this code
 html  
      {  
           height:100%;  
           width:100%;  
           background:url(http://www.southsoft.co.za/images/mysql.jpg) center center no-repeat;  
           /* You can also give local file path */  
      }  

Find any image and change with file name.
0 comments

New Custom CSS (Cascading Style Sheet) Layout for php scripts

I was using simple coding without any Cascading Style Sheet (CSS). that's why everything was simple in scripting.
like

Simple Layout
Old Layout
Now I am learning CSS with PHP classes.  I am using Simple Style Sheet Code. Now I am using this Simple Style Sheet Concept.
simple and new layout
New Layout

In this CSS, I am using 2 Images, and some color functionality.
0 comments

Some Important Functions of PHP : 5th Day Lecture of PHP : Samee


php strings

Some Important Functions of PHP

Sample 1 : strpos() Function Usage

As $name2 is "Feroz"
12
it will used to show the value location of starting $name2

Sample 2 : strlen() Function Usage

As $name1 is "Samee Ullah Feroz"
17= it will used to show the lenght of String $name1

Sample 3 : strtolower() Function Usage

samee ullah feroz

Sample 4 : strtoupper() Function Usage

SAMEE ULLAH FEROZ

Sample 5 : ucfirst() Function Usage

Samee ullah feroz

Sample 6 : ucwords() Function Usage

Samee Ullah Feroz

Sample 7 : implode() Function Usage

Samee_Ullah_Feroz

Sample 8 : explode() Function Usage

array (size=3)
  0 => string 'Samee' (length=5)
  1 => string 'Ullah' (length=5)
  2 => string 'Feroz' (length=5)

Sample 9 : substr() Function Usage


Ullah Feroz
Feroz
oz

Samee Ullah Feroz
Feroz
eroz
e Ullah Feroz

 <html>  
   <head>  
     <title>Some Important Functions of PHP : 5th Day Lecture : Samee</title>  
     <link rel="icon" type="image/ico" href="http://www.iconarchive.com/download/i50954/deleket/3d-cartoon-vol3/Web-Coding.ico" alt="Icon" />  
     <link type="text/css" href="http://www.getacho.com/download/phpcss/stylesheet.css" rel="stylesheet" />  
   </head>  
   <body>  
        <img id="logo" src="http://icons.iconarchive.com/icons/deleket/3d-cartoon-vol3/256/Web-Coding-icon.png" alt="Coding">  
     <h1 align="center">Some Important Functions of PHP : <a href="http://sameearticles.blogspot.com" target="_blank">Samee Articles</a></h1>  
       <h2 align="left">Sample 1 : strpos() Function Usage</h2>  
         <?php  
                          $name1 = "Samee Ullah Feroz";  
                          $name2 = "Feroz";  
                          echo 'As $name2 is "Feroz"<br />';  
                          echo strpos($name1, $name2) . "<br />it will used to show the value location of starting \$name2"  
         ?>  
       <h2 align="left">Sample 2 : strlen() Function Usage</h2>  
         <?php  
                          $name1 = "Samee Ullah Feroz";  
                          $name2 = "Feroz";  
                          echo 'As $name1 is "Samee Ullah Feroz"<br />';  
                          echo strlen("$name1") . "=\tit will used to show the lenght of String \$name1";  
                          //And We can also write Full Name in the place of $name1 and also we can write string either with double qoutes or without qoutes  
         ?>  
       <h2 align="left">Sample 3 : strtolower() Function Usage</h2>  
         <?php  
                          $name1 = "Samee Ullah Feroz";  
                          $name2 = "Feroz";  
                          echo strtolower($name1); //As it is used to convert all letters to lower case.  
         ?>  
       <h2 align="left">Sample 4 : strtoupper() Function Usage</h2>  
         <?php  
                          $name1 = "Samee Ullah Feroz";  
                          $name2 = "Feroz";  
                          echo strtoupper($name1); //As it is used to Convert all letters to upper case (Capital Letters)  
         ?>  
       <h2 align="left">Sample 5 : ucfirst() Function Usage</h2>  
         <?php  
                          $name1 = "samee ullah feroz";  
                          $name2 = "Feroz";  
                          echo ucfirst($name1); //As it is used to Convert 1st letter to upper case (Capital Letter)  
         ?>  
       <h2 align="left">Sample 6 : ucwords() Function Usage</h2>  
         <?php  
                          $name1 = "samee ullah feroz";  
                          $name2 = "Feroz";  
                          echo ucwords($name1); //As it is used to Convert each 1st letter to upper case (Capital Letters)  
         ?>  
       <h2 align="left">Sample 7 : implode() Function Usage</h2>  
         <?php  
                          $name1 = array("Samee","Ullah","Feroz");  
                          $name2 = "Feroz";  
                          echo implode("_",$name1); //As it is used to join the array values and add specific charactor among each value.  
         ?>  
       <h2 align="left">Sample 8 : explode() Function Usage</h2>  
         <?php  
                          $name1 = "Samee Ullah Feroz";  
                          $name2 = "Feroz";  
                          $name3 = explode(" ",$name1);  
                          var_dump($name3);  
         ?>  
       <h2 align="left">Sample 9 : substr() Function Usage</h2>  
         <?php  
                          echo substr("Samee Ullah Feroz",18)."<br />";  
                          echo substr("Samee Ullah Feroz",6)."<br />";  
                          echo substr("Samee Ullah Feroz",11)."<br />";  
                          echo substr("Samee Ullah Feroz",15)."<br />";  
                          echo "<br>";  
                          // Negative numbers:  
                          echo substr("Samee Ullah Feroz",-18)."<br />";  
                          echo substr("Samee Ullah Feroz",-6)."<br />";  
                          echo substr("Samee Ullah Feroz",-4)."<br />";  
                          echo substr("Samee Ullah Feroz",-13)."<br />";  
         ?>  
   </body>  
 </html>  


0 comments

A, B, C, E And F String Functions In PHP with Priority : 5th Day Lecture of PHP

string functions

Sample 1 : addcslashes() Function Usages : 0.5 Priority

Samee \Ullah Feroz

Sample 2 : addslashes() Function Usages : 0.5 Priority

My Name is \"Samee Ullah Feroz\" Understand?

Sample 3 : bin2hex() Function Usages : 0.6 Priority

48656c6c6f20576f726c6421

Sample 4 : chop() Function Usages : 0.4 Priority

Samee Ullah Feroz
Samee Ullah Feroz

Sample 5 : chr() Function Usages : 0.7 Priority

é
ž
î

Sample 6 : chunk_split() Function Usages : 0.6 Priority

Sa|me|e |Ul|la|h |Fe|ro|z|

Sample 7 : convert_cyr_string() Function Usages : 0.3 Priority

Hello world! æøå
Hello world! ƒ.ƒñƒ

Sample 8 : convert_uudecode() Function Usages : 0.7 Priority

14V%M964@56QL86@@1F5R;WH` `
Samee Ullah Feroz

Sample 9 : convert_uuencode() Function Usages : 0.7 Priority

14V%M964@56QL86@@1F5R;WH` `
Samee Ullah Feroz

Sample 10 : count_chars() Function Usages : 0.3 Priority

FSUaehlmorz

Sample 11 : crc32() Function Usages : 0.4 Priority

4289894317

Sample 12 : echo() Function Usages : 1.0 Priority

sami

Sample 13 : explode() Function Usages : 0.5 Priority

Array ( [0] => Samee [1] => Ullah [2] => Feroz. [3] => It's [4] => a [5] => beautiful [6] => day. )

Sample 14 : fprintf()Function Usages : 0.6 Priority


 <html>  
      <head>  
           <title>A, B, C, E and F : String Functions in PHP: 5th Day Lecture of PHP</title>  
      </head>  
      <body>  
           <h1 align="center">A, B, C, E And F String Functions In PHP with Priority</h1>  
                <h2 align="left">Sample 1 : addcslashes() Function Usages : 0.5 Priority</h2>  
                     <?php  
                          $str = addcslashes("Samee Ullah Feroz","U");   
                               #It is used to add slashes before specific character  
                               //Syntax is : addcslashes(string,characters)  
                          echo ($str);  
                     ?>  
                <h2 align="left">Sample 2 : addslashes() Function Usages : 0.5 Priority</h2>  
                     <?php  
                          $str = addslashes('My Name is "Samee Ullah Feroz" Understand?');  
                               #It is used to add slashes before double qoutes.  
                               //Syntax is : addslashes(string)  
                          echo($str);   
                     ?>  
                <h2 align="left">Sample 3 : bin2hex() Function Usages : 0.6 Priority</h2>  
                     <?php  
                          $str = bin2hex('Hello World!');  
                          #It is used to convert value to its Hexadecimal Values  
                          //Syntax is : bin2hex(string)  
                          echo($str);  
                     ?>  
                <h2 align="left">Sample 4 : chop() Function Usages : 0.4 Priority</h2>  
                     <?php  
                          $str = "Samee Ullah Feroz";  
                          echo $str . "<br />";  
                          echo chop($str,"Ullah"); //I am getting Error here  
                          #It is used to remove values from right side  
                          //Syntax is : chop(string,charlist)   
                     ?>  
                <h2 align="left">Sample 5 : chr() Function Usages : 0.7 Priority</h2>  
                     <?php  
                          echo chr(233) . "<br>";  
                          echo chr(158) . "<br>";  
                          echo chr(238) . "<br>";  
                          #It is used to show ASCII Values  
                          //Syntax is : chr(ascii)  
                     ?>  
                <h2 align="left">Sample 6 : chunk_split() Function Usages : 0.6 Priority</h2>  
                     <?php  
                          $str = "Samee Ullah Feroz";  
                          echo chunk_split($str,2,"|");  
                          #It is used to separate characters by given character like I separated by |  
                          //Syntax is : chunk_split(string,length,end)  
                     ?>  
                <h2 align="left">Sample 7 : convert_cyr_string() Function Usages : 0.3 Priority</h2>  
                     <?php  
                          $str = "Hello world! æøå";  
                          echo $str . "<br />";  
                          echo convert_cyr_string($str,'w','a');  
                          #it is used to convert character set to an other  
                          //Syntax is : convert_cyr_string(string,from,to)  
                     ?>  
                <h2 align="left">Sample 8 : convert_uudecode() Function Usages : 0.7 Priority</h2>  
                     <?php  
                          $str = "Samee Ullah Feroz";  
                          // Encode the string  
                          $encodeString = convert_uuencode($str); //here this code will convert your value to a specific code  
                          echo $encodeString . "<br>";  
                          // Decode the string  
                          $decodeString = convert_uudecode($encodeString); #here this code will decode that specific code to your specific value.  
                          echo $decodeString;  
                          #It is used to decoded a string value.  
                          //Syntax is : convert_uudecode(string)  
                     ?>  
                <h2 align="left">Sample 9 : convert_uuencode() Function Usages : 0.7 Priority</h2>  
                     <?php  
                          $str = "Samee Ullah Feroz";  
                          // Encode the string  
                          $encodeString = convert_uuencode($str); //here this code will convert your value to a specific code  
                          echo $encodeString . "<br>";  
                          // Decode the string  
                          $decodeString = convert_uudecode($encodeString); #here this code will decode that specific code to your specific value.  
                          echo $decodeString;  
                          #It is used to encode a string value.  
                          //Syntax is : convert_uuencode(string)   
                     ?> 
    
  <h2 align="left">Sample 10 : count_chars() Function Usages : 0.3 Priority</h2>
   <?php
     $str = "Samee Ullah Feroz";
     echo count_chars($str,3);
     #It is used to show string with all different characters.
     //Syntax is : count_chars(string,mode)
   ?>
    
  <h2 align="left">Sample 11 : crc32() Function Usages : 0.4 Priority</h2>
   <?php
     $str = crc32("Samee Ullah Feroz");
     printf("%u\n",$str);
     //crc32() function is used to return a calculate value of a 32-bit CRC (cyclic redundancy checksum) for a string.
     #Syntax is : crc32(string) 
   ?>
  <h2 align="left">Sample 12 : echo() Function Usages : 1.0 Priority</h2>
    <?php
     $str = "sami"; 
      #It is used to print the value
      //Syntax is : echo(strings)
     echo ($str);
    ?>
    
  <h2 align="left">Sample 13 : explode() Function Usages : 0.5 Priority</h2>
    <?php
     $str = "Samee Ullah Feroz. It's a beautiful day."; 
     print_r (explode(" ",$str)); //Need to ask about this error
     //It is used to break a string into an array
     # explode(separator,string,limit)
    ?>
    
  <h2 align="left">Sample 14 : fprintf()Function Usages : 0.6 Priority</h2>
    <?php
     $number = 9;
     $str = "Lahore";
     $file = fopen("test.txt","w"); // Need to understand this function
     echo fprintf($file,"There are %u million dollars in %s.",$number,$str); //38 characters will be printed in text file
     echo($str); // limit and $str name
     #It is used to write some text in Text file.
     //Syntax is : fprintf(stream,format,arg1,arg2,arg++) 
    ?>
      </body>  
 </html>   


0 comments
 
Copyright © 2011-2026. Samee Articles - All Rights Reserved
Proudly powered by Blogger