Sunday, May 13, 2018

file traverse and restore backup file in php

<?php
ini_set('max_execution_time', 300);
function DirLineCounter( $dir , $result = array('lines_html' => false), $complete_table = true )
  {

      $file_read = array('php','ctp');
      $dir_ignore = array();     
      $scan_result = scandir( $dir );     
      foreach ( $scan_result as $key => $value ) {       
          if ( !in_array( $value, array( '.', '..' ) ) ) {           
              if ( is_dir( $dir . DIRECTORY_SEPARATOR . $value ) ) {               
                  if ( in_array( $value, $dir_ignore ) ) {
                    continue;
                  }               
                  $result = DirLineCounter( $dir . DIRECTORY_SEPARATOR . $value, $result, false );                 
              }
              else {               
              $type = explode( '.', $value );
              $type = array_reverse( $type );
              $ext=$type[0];
              if( !in_array($ext , $file_read ) ) {
                continue;
              }
              $file=str_replace('.'.$ext, '', $value);
              $nameArr=explode('_', $file);
              if(in_array('12-05-2018', $nameArr)){
              $newFile=str_replace('_bck_12-05-2018', '', $value);
              //unlink($dir . DIRECTORY_SEPARATOR . $newFile); // for delete new file
              if(file_exists($dir . DIRECTORY_SEPARATOR . $newFile)){
                rename($dir . DIRECTORY_SEPARATOR . $newFile,$dir . DIRECTORY_SEPARATOR . $newFile.'_restore');               
              }
              rename($dir . DIRECTORY_SEPARATOR . $value,$dir . DIRECTORY_SEPARATOR . $newFile);
              $result['lines_html'][] = '<tr><td>' . $dir . '</td><td>' . $value.'-->'.$newFile. '</td></tr>';
              }
             
              }
          }
      }     
      if ( $complete_table ) {   
        if(!empty($result['lines_html'])){
          $lines_html = implode('', $result['lines_html']);
        } else {
          $lines_html='';
        }
        return '<table><tr><td style="width: 60%; background-color:#ddd;">Dir</td><td style="width: 30%; background-color:#ddd;">File</td></tr>' . $lines_html . '</table>';       
      }
      else {
        return $result;
      }     
  }
  echo DirLineCounter( '../' );

Sunday, May 6, 2018

cakephp interview questions


Q. cakephp directory structure
— root (the root directory)
— — app (here’s where your application logic will go)
— — — config (application specific configurations)

— — — controllers (controllers go here)
— — — — components
— — — index.php
— — — models (models go here)
— — — plugins (third party apps – go here)
— — — views (view related files go here)
— — — — elements (small repeated layout items go here)
— — — — errors (error pages go here)
— — — — helpers (your home-based helpers go here)
— — — — layouts (page layouts go here)
— — — — pages (static content managed by PagesController go here)
— — — webroot (this directory as your webroot, and stick your public files in here)
— — — — css
— — — — files
— — — — img
— — — — js
— — cake (this is where the libraries are placed: Note: it’s best not to touch)
— — index.php
— — tmp (used for logs, baking, etc.)
— — vendors (stick your third party libraries here)

Q. cakephp component, module difference
Component: share logic between controller
Module: share logic between models
Plugin: combination of controller, view, model
Q. difference with codeigniter
Q. what is scaffolding
Q. how databse relation ship in cakephp
Q. can I call view directly
Q. what will happen if same url patern found… (error or what )
Q. first file run?
Q. what is Helpers?
running flow of cakphp
why use cakephp
is it support multiple database
can i cange dtabse from mysql to other if yes how

codeigniter interview questions


Q. directory structure
Q. difference with cakephp
Q. how  session variable created unset and retrieve
Q. how to write query
Q. default controller
Q. what is hooks
Q. what is routing
Q. first file run?
Q

javascript interview questions


what are the selecters in jquery
how to send ajax request by jquery
windowload
how to reload a page
three select option, two have common data and third one have that common data. when a valuse is selected in third select
option other select option automaticaly select the valuse that is selected in third select option using jquery
how to send ajax request in javascript and jquery
getting current url using js, jquery  var currentURL = window.location.href;
                $(location).attr('href');      // http://www.refulz.com:8082/index.php#tab2
                $(location).attr('pathname');  // index.php

which function you have used in jquery
what is document.ready()
what is $ in jquery
document.ready function and $

mysql interview questions


Q finding the 2nd, 3rd, 4th highest/lowest salary and fetching all records
SELECT DISTINCT(column name) FROM table ORDER BY (column name) desc LIMIT n-1,1
 
SELECT * FROM Employee Emp1 
WHERE (N-1) = ( 
    SELECT COUNT(DISTINCT(Emp2.Salary)) 
    FROM  Employee Emp2 
    WHERE Emp2.Salary > Emp1.Salary)

Select record of all employee  whose salary is 2nd highest.
select * from sallary where sallary = (select distinct sallary from sallary order by sallary desc limit 1,1)

SELECT MAX(Salary) FROM Employee
  WHERE Salary NOT IN (SELECT MAX(Salary) FROM Employee )

Q. storage engines
Engine     | Support | Comment                                                        | Transactions | XA   | Savepoints |
+------------+---------+----------------------------------------------------------------+--------------+------+------------+
| InnoDB     | YES     | Supports transactions, row-level locking, and foreign keys     | YES          | YES  | YES        |
| MRG_MYISAM | YES     | Collection of identical MyISAM tables                          | NO           | NO   | NO         |
| BLACKHOLE  | YES     | /dev/null storage engine (anything you write to it disappears) | NO           | NO   | NO         |
| CSV        | YES     | CSV storage engine                                             | NO           | NO   | NO         |
| MEMORY     | YES     | Hash based, stored in memory, useful for temporary tables      | NO           | NO   | NO         |
| FEDERATED  | NO      | Federated MySQL storage engine                                 | NULL         | NULL | NULL       |
| ARCHIVE    | YES     | Archive storage engine                                         | NO           | NO   | NO         |
| MyISAM     | DEFAULT | Default engine as of MySQL 3.23 with great performance         | NO           | NO   | NO         |
+------------+---------+------------------------------------------------------
MyISAM and InnoDB are the most commonly used engines.
MyISAM is slightly faster than InnoDB, and implements the FULLTEXT index which is quite useful for integrating search capabilities. MyISAM is not transacted and doesn't implement foreign key constraints, which is a major drawback.
But you can use the best of both and create tables with different storage engines. Some software (WordPress, I think) use Inno for most data, like relations between pages, versions etc. Records for the posts contain an ID that links to a record in a separate content table that uses MyISAM. That way, the content is stored in the table that has the best search capabilities, while most other data is stored in tables that enforce data integrity.
If I were you, I'd pick Inno, because it is the most reliable. Only use MyISAM for specific purposes if you need to.
You can configure your database to use InnoDB by default when creating new tables.

Different storage engines available, there are few reasons not to use either the MyISAM or InnoDB engine types. MyISAM will do in most situations, but if you have a high number of updates or inserts compared to your searches and selects then you will get better performance out of the InnoDB engine. To get the best performance out of InnoDB you need to tweak the parameters for your server, otherwise there is no reason not to use it.
The MERGE engine is an exceedingly effective way of querying data from multiple, identically defined, tables.
 The MEMORY engine is the best way to perform a large number of complex queries on data that would be inefficient to search on a disk based engine.
 The CSV engine is a great way to export data that could be used in other applications.
 BDB is excellent for data that has a unique key that is frequently accessed.



Selecting nth number from sql
SELECT TOP 1 salary
FROM (
      SELECT DISTINCT TOP n salary
      FROM employee
      ORDER BY salary DESC
      ) a
ORDER BY salary

first query select first element from top and it is in ascending means lowest at top and
second query selects top “n” query from table and it is descending means if we want 3rd highest first we select 3 hightest sallery in descending order than will arrange it to ascending and select first that is desire 3rd highest.
SELECT MIN(EmpSalary) from (
SELECT EmpSalary from Employee ORDER BY EmpSalary DESC LIMIT 3
);
 
SELECT DISTINCT(Salary) FROM table ORDER BY Salary DESC LIMIT n-1,1;

My|sam and innodb diference
MYISAM:
1.     MYISAM supports Table-level Locking
2.     MyISAM designed for need of speed
3.     MyISAM does not support foreign keys hence we call MySQL with MYISAM is DBMS
4.     MyISAM stores its tables, data and indexes in diskspace using separate three different files. (tablename.FRM, tablename.MYD, tablename.MYI)
5.     MYISAM not supports transaction. You cannot commit and rollback with MYISAM. Once you issue a command it’s done.
6.     MYISAM supports fulltext search
7.     You can use MyISAM, if the table is more static with lots of select and less update and delete.
INNODB:
1.     InnoDB supports Row-level Locking
2.     InnoDB designed for maximum performance when processing high volume of data
3.     InnoDB support foreign keys hence we call MySQL with InnoDB is RDBMS
4.     InnoDB stores its tables and indexes in a tablespace
5.     InnoDB supports transaction. You can commit and rollback with InnoDB



how to find 2nd,3rd...nth highest/lowest sallery.
fetching record of all employee have 4th highest sallery
what is triger
type of database engine in mysql and to change them    ALTER TABLE t ENGINE = MYISAM;
difference in database engines
what is group by and  having clause
what is indexing and how to achieve it
checking number result obtained
query for getting all vote to a candidate from two table(one has name and other has vote)
what is indexing in mysql, ho to do it
acid property
transaction
delete vs truncate
what are joins
what is subquery
nth highest sallery
left right joins
sql injuctions
table types (storage types)
indexes andits uses, maximum 16 index can be defined
heap tables what is
default port of mysql : 3306
enum and sets
char and varchar
get  version of mysql : select version();
primary key & candidate key
what are federated tables: which allow access to the tables located on other database on another servers
autoincrement: automatically increased value. When maximum value reached it stops and error flashed
how to see indexes defind for a table: show index from tablename
% and _ and like uery
Difference in like and regrex operators
Difference in blob and text
Myisam: develop by ibm to store data like tape. Full form: mysql indexed sequential access method
By using created statement we can create database, event, function, index, procedure, table, trigger, user, view
Trigerss allowed insert, update,delete on before or after each, means 6 combination of 2 each
Common sql function
Rdms and itrs features and dbms
Data mining means
Maximum 64 colums can be updated in a single query, 64 chars leght name can be create
Ddl, dml, dcl
Delete vs truncate
Heap and temporary table
Float nad doubles
Char vs varchar: 255,4000 charcters, fixed size, variable, 50% faster is char than varchar, static memory allocation usred, dyanamic used
Mysql connect nad mysql p connect

Nth salary : select distict(salary0 from emp order by salary desc limit n-1,1
fro getting latest record in group by query
SELECT id, branchId, roleId FROM mapping WHERE id IN ( SELECT MAX(id) FROM mapping GROUP BY branchId )
Primary vs unique


php interview questions


Q. Difference  in echo and print???
1.      Speed. There is a difference between the two, but speed-wise it should be irrelevant which one you use. echo is marginally faster since it doesn't set a return value if you really want to get down to the nitty gritty.
2.      Expression. print() behaves like a function in that you can do: $ret = print "Hello World"; And $ret will be 1. That means that print can be used as part of a more complex expression where echo cannot. An example from the PHP Manual:
$b ? print "true" : print "false";
print is also part of the precedence table which it needs to be if it is to be used within a complex expression. It is just about at the bottom of the precedence list though. Only "," AND, OR and XOR are lower.
3.      Parameter(s). The grammar is: echo expression [, expression[, expression] ... ] But echo ( expression, expression ) is not valid. This would be valid: echo ("howdy"),("partner"); the same as: echo "howdy","partner"; (Putting the brackets in that simple example serves no purpose since there is no operator precedence issue with a single term like that.)
So, echo without parentheses can take multiple parameters, which get concatenated:
   echo  "and a ", 1, 2, 3;   // comma-separated without parentheses
   echo ("and a 123");        // just one parameter with parentheses
print() can only take one parameter:
   print ("and a 123");
   print  "and a 123";

Q. What are super global variable and example
9 variables in PHP are "superglobals", which means that they are always accessible, regardless of scope - and you can access them from any function, class or file without having to do anything special.
The PHP superglobal variables are:
  • $_GET
  • $_POST
  • $_REQUEST
  • $_FILES
  • $_COOKIE
  • $_SESSION
  • $GLOBALS
  • $_SERVER
  • $_ENV

$GLOBALS is a PHP super global variable which is used to access global variables from anywhere in the PHP script (also from within functions or methods).PHP stores all global variables in an array called $GLOBALS[index]. The index holds the name of the variable.
<?php 
$x = 75; 
$y = 25;
 
function addition() { 
    $GLOBALS['z'] = $GLOBALS['x'] + $GLOBALS['y']; 
}
 
addition(); 
echo $z; 
?>
$_SERVER is a PHP super global variable which holds information about headers, paths, and script locations.
$_SERVER['PHP_SELF']
Returns the filename of the currently executing script
$_SERVER['GATEWAY_INTERFACE']
Returns the version of the Common Gateway Interface (CGI) the server
 is using
$_SERVER['SERVER_ADDR']
Returns the IP address of the host server
$_SERVER['SERVER_NAME']
Returns the name of the host server (such as www.w3schools.com)
$_SERVER['SERVER_SOFTWARE']
Returns the server identification string
 (such as Apache/2.2.24)
$_SERVER['SERVER_PROTOCOL']
Returns the name and revision of the information protocol
(such as HTTP/1.1)
$_SERVER['REQUEST_METHOD']
Returns the request method used to access the page
 (such as POST)
$_SERVER['REQUEST_TIME']
Returns the timestamp of the start of the request
 (such as 1377687496)
$_SERVER['QUERY_STRING']
Returns the query string if the page is accessed via
a query string
$_SERVER['HTTP_ACCEPT']
Returns the Accept header from the current request
$_SERVER['HTTP_ACCEPT_CHARSET']
Returns the Accept_Charset header from the current request
(such as utf-8,ISO-8859-1)
$_SERVER['HTTP_HOST']
Returns the Host header from the current request
$_SERVER['HTTP_REFERER']
Returns the complete URL of the current page (
not reliable because not all user-agents support it)
$_SERVER['HTTPS']
Is the script queried through a secure HTTP protocol
$_SERVER['REMOTE_ADDR']
Returns the IP address from where the user is viewing the current page
$_SERVER['REMOTE_HOST']
Returns the Host name from where the user is viewing the current page
$_SERVER['REMOTE_PORT']
Returns the port being used on the user's machine to
communicate with the web server
$_SERVER['SCRIPT_FILENAME']
Returns the absolute pathname of the currently
 executing script
$_SERVER['SERVER_ADMIN']
Returns the value given to the SERVER_ADMIN
 directive in the web server configuration file
(if your script runs on a virtual host, it will be
the value defined for that virtual host)
 (such as someone@w3schools.com)
$_SERVER['SERVER_PORT']
Returns the port on the server machine being used by
 the web server
 for communication (such as 80)
$_SERVER['SERVER_SIGNATURE']
Returns the server version and virtual host name which are added
to server-generated pages
$_SERVER['PATH_TRANSLATED']
Returns the file system based path to the current script
$_SERVER['SCRIPT_NAME']
Returns the path of the current script
$_SERVER['SCRIPT_URI']
Returns the URI of the current page
$_GET:  limit 2000 characters, send via url, data can be seen, no security, files images can’t be sent, we can bookmark a page
$_POST: all names/values are embedded within the body of the HTTP request, has no limit, secure, files images can be sent, variable are not seen show we can bookmark a page
$_FILES:  enctype="multipart/form-data" must be added to form, method will be post,
move_uploaded_file($_FILES['photo']['tmp_name'],"uploads/candidate/photo/".$photo)
Getimagesize() to get uploading image height and width
file_exists(url) to check file exist or not
if ($_FILES["fileToUpload"]["size"] > 500000) limit upload
$imageFileType = pathinfo($target_file,PATHINFO_EXTENSION); to get extension
$_COOKIE: A cookie is often used to identify a user. A cookie is a small file that the server embeds on the user's computer. Each time the same computer requests a page with a browser, it will send the cookie too. With PHP, you can both create and retrieve cookie values
setcookie(name, value, expire, path, domain, secure, httponly);
$cookie_name = "user";
$cookie_value = "John Doe";
setcookie($cookie_name, $cookie_value, time() + (86400 * 30), "/"); // 86400 = 1 day
To disable a cookie set cookie with past date.
if(count($_COOKIE) > 0) To check cookie is enable
$_SESSION A session is a way to store information (in variables) to be used across multiple pages. It stores in tmp folder on the server.
session_start();
$_SESSION["favcolor"] = "green";
session_destroy();session_unset();  unset($_SESSION["favcolor"]);
default time 24 minutes (1440 seconds)
increase sesion time // server should keep session data for AT LEAST 1 hour
ini_set('session.gc_maxlifetime', 3600);
 
// each client should remember their session id for EXACTLY 1 hour
session_set_cookie_params(3600);
 
session_start(); // ready to go!
 
To change session path: ini_set(session.save_path, '/path/to/your/folder')
ini_set('session.save_path',realpath(dirname($_SERVER['DOCUMENT_ROOT']) . '/../session'));
session_start();
Apache used /var/tmp, while CLI used something like /var/folders/kf/hk_dyn7s2z9bh7y_j59cmb3m0000gn/T

Get session id $a = session_id();
if(empty(
$a)) session_start();
echo 
"SID: ".SID."<br>session_id(): ".session_id()."<br>COOKIE: ".$_COOKIE["PHPSESSID"];
Q. Headers in php: The header() function sends a raw HTTP header to a client. It is important to notice that header() must be called before any actual output is sent (In PHP 4 and later, you can use output buffering to solve this problem)
header('Location: http://www.example.com/');
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
header("Cache-Control: no-cache");
header("Pragma: no-cache");
Let the user be prompted to save a generated PDF file (Content-Disposition header is used to supply a recommended filename and force the browser to display the save dialog box):
<?php
header("Content-type:application/pdf");

// It will be called downloaded.pdf
header("Content-Disposition:attachment;filename='downloaded.pdf'");

// The PDF source is in original.pdf
readfile("original.pdf");
?>

<html>
<body>



Q. How to concatate two strings in php  by .  operater $a=”ram”.”test”;
String functions:
 trim() along with ltrim() and rtrim() strip characters from a string. trim($string) without any further arguments will strip all spaces, carriage returns, new lines, null characters, and vertical tabs from $string.
trim($string, 'ld'): Hello Wor
str_replace() replaces all instances of a given character with another. To strip out all ‘l’s from our string, use
echo str_replace('l', '', $string);
This returns “Heo Word”.
 strtolower() transforms a string into all lower-case letters.
Strtoupper(),strtotime(time), ucfirst($str), ucwords($str)
echo strlen($string);
substr($string, 3);: lo World,  after 3rd all charcter
echo substr($string, -1); d from last 1 character
strpos($string, 'l'); :2, position of a character in a string
Removes whitespace or other characters from the right end of a string
Returns a string with backslashes in front of the specified characters
Returns a string with backslashes in front of predefined characters
Outputs one or more strings
Outputs one or more strings
Outputs a formatted string
 str_getcsv() function parses a string for fields in CSV format and returns an array containing the fields read.
Repeats a string a specified number of times
Replaces some characters in a string (case-sensitive)
Count the number of words in a string
Splits a string into an array
Finds the first occurrence of a string inside another string (alias of strstr())
Compares two strings (case-sensitive)
Strips HTML and PHP tags from a string
Returns the length of a string
String comparison of the first n characters (case-sensitive)
Returns the position of the first occurrence of a string inside another string (case-sensitive)




Q. PHP array
1. Indexed array          2. Associative array     3. Multidimensional array
1. Indexed array
$cars = array("Volvo", "BMW", "Toyota");
echo "I like " . $cars[0] . ", " . $cars[1] . " and " . $cars[2] . ".";

Getting the length of the array: <?php  echo count($cars); ?>



2.Associative array

<?php
$age = array("Peter"=>"35", "Ben"=>"37", "Joe"=>"43");
echo "Peter is " . $age['Peter'] . " years old.";
foreach($age as $x => $x_value) {
    echo "Key=" . $x . ", Value=" . $x_value;
    echo "<br>";
}
?>

3.Multidimesional array
$cars = array
  (
  array("Volvo",22,18),
  array("BMW",15,13),
  array("Saab",5,2),
  array("Land Rover",17,15)
  );

Returns the values from a single column in the input array
Creates an array by using the elements from one "keys" array and one "values" array
Counts all the values of an array
Fills an array with values
Fills an array with values, specifying keys
Checks if the specified key exists in the array
Merges one or more arrays into one array
Deletes the last element of an array
Inserts one or more elements to the end of an array
Returns one or more random keys from an array
Returns an array in the reverse order
Searches an array for a given value and returns the key
Removes the first element from an array, and returns the value of the removed element
Returns the sum of the values in an array
Removes duplicate values from an array
Sorts an associative array in descending order, according to the value
Sorts an associative array in ascending order, according to the value
Returns the number of elements in an array
Returns the current element in an array
Sets the internal pointer of an array to its last element
Sorts an associative array in descending order, according to the key
Sorts an associative array in ascending order, according to the key
Sorts an indexed array in descending order
Sorts an indexed array in ascending order

Q. array.push, array.pop, how to insert an element in an array
Q. Difference in array merge and combinbe
Q. how you will check a variable is array or not, or string/number
  • ctype_digit() - Check for numeric character(s)
  • is_bool() - Finds out whether a variable is a boolean
  • is_null() - Finds whether a variable is NULL
  • is_float() - Finds whether the type of a variable is float
  • is_int() - Find whether the type of a variable is integer
  • is_string() - Find whether the type of a variable is string
  • is_object() - Finds whether a variable is an object
  • is_array() - Finds whether a variable is an array
is_numeric  Finds whether a variable is a number or a numeric string

Q abstract, class, method, variable, polymorphism, function overloading, function overriding,
polymorphism allows you define one interface and have multiple implementations
two types are in java
1 method overloading also compile time: method difned several times by changing argument data type and number of argument
 2 method overriding also runtime : defined function in base class also defined in child class

Abstract method: function only declare not defined in the class
Abstract class: Classes defined as abstract may not be instantiated, and any class that contains at least one abstract method must also be abstract.
Abstract classes are classes that contain one or more abstract methods. An abstract method is a method that is declared, but contains no implementation. Abstract classes may not be instantiated, and require subclasses to provide implementations for the abstract methods.
interfaces are abstract classes with no method declared.
Default visibility public and only do not support multiple inheritance.
Can implements many interface but can extend only one class

Q. final class and final method difference
if methode is final, it can’t be override and if a class is final it can’t be extended.
Q cookies
setcookie(name, value, expire, path, domain, security);
Here is the detail of all the arguments:
·        Name - This sets the name of the cookie and is stored in an environment variable called HTTP_COOKIE_VARS. This variable is used while accessing cookies.
·        Value -This sets the value of the named variable and is the content that you actually want to store.
·        Expiry - This specify a future time in seconds since 00:00:00 GMT on 1st Jan 1970. After this time cookie will become inaccessible. If this parameter is not set then cookie will automatically expire when the Web Browser is closed.
·        Path -This specifies the directories for which the cookie is valid. A single forward slash character permits the cookie to be valid for all directories.
·        Domain - This can be used to specify the domain name in very large domains and must contain at least two periods to be valid. All cookies are only valid for the host and domain which created them.
·        Security - This can be set to 1 to specify that the cookie should only be sent by secure transmission using HTTPS otherwise set to 0 which mean cookie can be sent by regular HTTP.
Following example will create two cookies name and age these cookies will be expired after one hour.
<?php
   setcookie("name", "John Watkin", time()+3600, "/","", 0);
   setcookie("age", "36", time()+3600, "/", "",  0);
?>
<html>
<head>
<title>Setting Cookies with PHP</title>
</head>
<body>
<?php echo "Set Cookies"?>
</body>
</html>

Officially, to delete a cookie you should call setcookie() with the name argument only but this does not always work well, however, and should not be relied on.
It is safest to set the cookie with a date that has already expired:
setcookie( "name", "", time()- 60, "/","", 0);


Q. what is $_server, how to get browser name   
   echo $_SERVER['HTTP_USER_AGENT'] . "\n\n"; 
 $browser = get_browser(null,true);
Current url-  <?php echo $_SERVER['REQUEST_URI']; ?>
Request method (get, post,put,delete)  $_SERVER['REQUEST_METHOD']



Q. difference in fetch_associate and fetch_array
fetch_array() returns two arrays, one with numeric keys and other with associative strings (column names), so here you can either use $row['column_name'] or $row[0]
Where as fetch_assoc() will return string indexed key array and no numeric array so you won't have an option here of using numeric keys like $row[0].
So the latter one is better in performance compared to fetch_array() and obviously using named indexes is far better compared to numeric indexes.



Q. Difference between two dates
<?php
$datetime1 = new DateTime('2015-08-29');
$datetime2 = new DateTime('2015-08-30');
$interval = $datetime1->diff($datetime2);
echo $interval->format('%R%a days');
?>

relation in session and cokkies
sesion and cokkies details in depth

difference between echo and print, which one is faster, is print return anything
what is ksort in php
how you will check a variable is array or not, or string/number        echo gettype($value), "\n";
types of array, how to declare them
plymorphism, function overloading, overriding and inheritance in php
session cokkie and how to use them and difference
what is $_server, how to get browser name      echo $_SERVER['HTTP_USER_AGENT'] . "\n\n";   $browser = get_browser
(null,true);
checking number result obtained             mysqli_num_rows($result);
difference in fetch_associate and fetch_array
constructer and distructor
array functions
finding unique value in array
number of days finding
swap two number without uing third variable
class and objects
what is consutructer
inheritance interface and abstract
method overloading vs method overriding
array_merge vs array_combine
strstr vs strops
print table without using loop
magic methods and magic constants
if vs switch
loop levels
mysql_fetch_aray and mysql_fetch_object