Saturday, August 16, 2014

PHP Features

uOpen source / Free software.
uCross Platform to develop, to deploy, and to use.
uPower,Robust, Scalable.
uWeb development specific.
uCan be Object Oriented.
uIt is faster to code and faster to execute.
uLarge, active developer community.
u20 million websites
uSupport for PHP is free.

uGreat documentation in many language www.php.net/docs.php

Brief History of PHP

u     PHP (PHP: Hypertext Preprocessor) was created by Rasmus Lerdorf in 1994. It was initially developed for HTTP usage logging and server-side form generation in Unix
u     PHP 2 (1995) transformed the language into a Server-side embedded scripting language. Added database support, file uploads, variables, arrays, recursive functions, conditionals, iteration, regular expressions, etc.
u     PHP 3 (1998) added support for ODBC data sources, multiple platform support, email protocols (SNMP,IMAP), and new parser written by Zeev Suraski and Andi Gutmans .
u     PHP 4 (2000) became an independent component of the web server for added efficiency. The parser was renamed the Zend Engine. Many security features were added.
u    PHP 5 (2004) adds Zend Engine II with object oriented programming, robust XML support using the libxml2 library, SOAP extension for interoperability with Web Services, SQLite has been bundled with PHP 

PHP Architecture

  uZend engine as parser (Andi Gutmans and  
      Zeev Suraski)
 uSAPI is a web server abstraction layer
 uPHP components now self contained 
      (ODBC, Java, LDAP, etc.)

 uThis structure is a good general design  
      for software (compare to OSI model,          and middleware applications).

What is PHP?

u"PHP Hypertext Preprocessor"
uScripting Server-Side language
uCreation of dynamic content – i.e. HTML and JSON
uInteraction with databases (CRUDs)
uServer side, or via command line (CLI)
uCan be embedded in HTML
uFirst introduced in 1995 as module for Apache
uOpen source, written in C
uSimilar to Perl and C
uPHP is "type-less" language.
uPHP originally stood for "PERSONAL HOME PAGE"
  uPHP runs on different platforms (Windows, Linux,                 Unix, etc.)‏    
  uPHP is compatible with almost all servers used today             (Apache, IIS, etc.)
  uPHP is easy to learn and runs efficiently on the server      side.
  uThe PHP code is enclosed in special start and end            processing instructions <?php and ?>  that allow you      to jump into and out of "PHP mode."

Friday, May 17, 2013

show current computer time program in C++



#include <iostream>
#include <ctime>
using namespace std;

int main( )
{
   // current date/time based on current system
   time_t now = time(0);
 
   // convert now to string form
   char* dt = ctime(&now);
   cout << "The local date and time is: " << dt;
   // convert now to tm struct for UTC
   tm *gmtm = gmtime(&now);
   dt = asctime(gmtm);
   cout << "\nThe UTC date and time is:"<< dt << endl;
}

Friday, May 03, 2013

binary search in C++


//binary search
#include<iostream>
#include<conio.h>
using namespace std;
int main()
{
   
    int n;
    cout<<"enter the array length: ";
    cin>>n;
   int bc[n];
      for(int i=0;i<=n;i++)
    {
            cout<<"the value of bc["<<i<<"] is: ";
    cin>>bc[i];
}
int m;
int c,f,mid;
c=1;
f=n+1;
mid=(c+f)/2;
    cout<<"enter a element you want to search :";
    cin>>m;
    while(c<=f && bc[mid]!=m)
 {   if (m<bc[mid])
   f=mid-1;
    else {
    c=mid+1;  }
    mid = (c+f)/2;
}
if(f>=c){

 cout<<"the element is located in mid";
}
else
{

    cout<<"the element is not located in mid";
}
    getch();
return 0;
}

TELL STAR OF USER in C++


#include<iostream>
using namespace std;
 int main()
 {
 int date,month;

 cout<<"\nEnter Date: ";
 cin>>date;
 cout<<"\nEnter Month: ";
 cin>>month;
 cout<<"\n\n";

if(month<=1 && date>=20)
 cout<<"Aquarius";
 else
if(month<=2 && date<=18)
 cout<<"Aquarius";
 else
 if(month<=2 && date>=19)
 cout<<"Pices";
 else
 if(month<=3 && date<=20)
 cout<<"Pices";
 else
 if(month<=3 && date>=21)
 cout<<"Aries";
 else
 if(month<=4 && date<=19)
 cout<<"Aries";
 else
 if(month<=4 && date>=20)
 cout<<"Taurus";
 else
 if(month<=5 && date<=20)
 cout<<"Taurus";
 else
 if(month<=5 && date>=21)
 cout<<"Gemini";
 else
 if(month<=6 && date<=20)
 cout<<"Gemini";
 else
 if(month<=6 && date>=21)
 cout<<"Cancer";
 else
 if(month<=7 && date<=22)
 cout<<"Cancer";
 else
 if(month<=7 && date>=23)
cout<<"Leo";
 else
 if(month<=8 && date<=22)
 cout<<"Leo";
 else
 if(month<=8 && date>=23)
 cout<<"Virgo";
 else
 if(month<=9 && date<=22)
 cout<<"Virgo";
 else
 if(month<=9 && date>=23)
 cout<<"Libra";
 else
 if(month<=10 && date<=22)
 cout<<"Libra";
 else
 if(month<=10 && date>=23)
 cout<<"Scorpio";
 else
 if(month<=11 && date<=21)
 cout<<"Scorpio";
 else
 if(month<=11 && date>=22)
 cout<<"Sagittarius";
 else
 if(month<=12 && date<=21)
 cout<<"Sagittarius";
 else
 if(month<=12 && date>=22)
 cout<<"Capricon";
 else
 if(month<=1 && date<=19)
 cout<<"Capricon";
 else
 cout<<"Invalid Month:";

 }