Friday, May 9, 2025
Home Blog Page 11

3 Awesome Security Plugins for WordPress

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc imperdiet rhoncus arcu non aliquet. Sed tempor mauris a purus porttitor, ac convallis arcu venenatis. Donec lorem erat, ornare in augue at, pharetra cursus mauris. Cras commodo orci vel scelerisque convallis. Fusce sollicitudin feugiat placerat. Aenean magna massa, vehicula at efficitur ac, vestibulum non felis. Aliquam quis feugiat sapien, eu sodales mauris.

Phasellus at auctor nibh. Morbi feugiat finibus nulla, et semper ipsum sodales a. Fusce at lacus vestibulum, luctus sapien quis, dictum erat. Phasellus orci sem, pretium nec blandit sed, faucibus eget massa. Aliquam lobortis sapien augue. Nullam dignissim elit ac libero egestas egestas. Vestibulum et convallis urna, fermentum porta mauris. Nam pellentesque lectus varius, facilisis metus at, elementum augue. Pellentesque suscipit enim massa. Curabitur elementum lorem neque, non accumsan orci vulputate placerat. Vestibulum nec mauris at dui mattis blandit. Duis nec lacinia lacus. Fusce consectetur, sapien posuere lobortis maximus, velit orci ornare felis, id elementum ex ipsum at enim. Integer lacinia ipsum nec purus sodales tristique. Curabitur iaculis at nisl et commodo.

Praesent mattis purus magna, ac iaculis tellus elementum blandit. Nullam massa ante, egestas non porta consequat, sodales ac elit. Phasellus vitae erat id massa volutpat tincidunt. Sed suscipit sed dui quis efficitur. Mauris consectetur placerat urna, ac pharetra libero suscipit ut. Mauris accumsan magna pretium ante imperdiet, ac varius augue interdum. Proin id congue leo. Curabitur eu nulla risus. Phasellus a sodales leo. Donec blandit massa et egestas dapibus. Phasellus non justo mi. Mauris leo sapien, molestie a auctor non, venenatis finibus purus.

.net framework tutorial

.NET FRAMEWORK  is the software that is required for execution of the dot net applications on any machine. This software asks the functionalities of an operating system and makes the code do execute on its control providing the benefits. Like:

  1. Platform independency
  2. Security
  3. Automatic memory management


The code which is runs on the under the control of the framework is referred as managed code and the code which runs on the operating system (machine code) is referred as un-managed code.

click here – .net framework latest version download

DEVELOPMENT OF .NET FRAMEWORK:

The development of the dot net framework has been started in the late 90s. Originally under the name NGSW (next generation windows services).

The framework has been developed following a set up specification referred as CLI specification:

CLI specifications are open specifications that are standardizes an ISO and ECMA (European Computer Manufacturer Association).giving a chance to third party to develop the third party.

CLI Specification takes 4 major things:  

CLS (Common Language Specification)

CTS (Common Type System)

BCL (Base Class Library)

VES (Virtual execution System)

ASP.NET DataList Control

ASP.NET DataList Control  Introduction:

The DataList control is, like the Repeater control, used to display a repeated list of items that are bound to the control. However, the DataList control adds a table around the data items by default. The DataList control may be bound to a database table, an XML file, or another list of items.

OR

The DataList control like the Repeater control is a template driven, light weight control, and acts as a container of repeated data items. The templates in this control are used to define the data that it will contain. It is flexible in the sense that you can easily customize the display of one or more records that are displayed in the control.

OR

The DataList Web server control displays data in a format that you can define using templates and styles. The DataList control is useful for data in any repeating structure, such as a table. The DataList control can display rows in different layouts, such as ordering them in columns or rows.

 

When the web page is in execution with the data bound to it using the Page_Load event, the data in the DataList control is rendered as DataListItem objects, that is, each item displayed is actually a DataListItem. Similar to the Repeater control, the DataList control supports Editing and Deleting features whereas Repeater does not support. The DataList control does not have Paging and Sorting functionalities built into it similar to Repeater control.

Also, DataList has RepeatDirection, RepeatColumns and RepeatLayout properties, which are unique for DataList control. These properties are useful when you need to create presentation with more than one record per row, like Image Gallery, Product Catalogue etc. For example, let say you are creating an image gallery and want to show 5 images per row. Repeater would require checking of record position and manipulating HTML. With DataList, just use RepeatDirection=”Horizontal” and RepeatColumns=”5″. RepeatLayout could be Table or Flow, depending of do you need HTML table structure in layout. These features are not possible using any other data controls.

The DataList Control includes a rich set of properties that we can use to format the HTML rendered by the control whereas Repeater Controls doesn’t not support this feature. If we want to associate Cascading Style Sheet rules with various elements of the DataList, then we can take advantage of any of the following properties:

CssClass: It enables us to associate a CSS class with the DataList.

 HeaderStyle: It enables us to format the header row of the DataList.

 FooterStyle: It enables us to format the footer row of the DataList.

 ItemStyle: It enables us to format each row displayed by the DataList.

AlternatingItemStyle: It enables us to format every other row of the DataList.

EditItemStyle: It enables us to format the DataList row selected for editing.

SelectedItemStyle: It enables us to format the selected row in the DataList.

SeparatorStyle: It enables us to format the row separator displayed by the DataList.

When formatting the DataList, we also need to work with the following properties:

GridLines: It enables us to add rules around the cells in the DataList. Possible values are None, Horizontal, Vertical, and Both.

ShowFooter: It enables us to show or hide the footer row.

ShowHeader: It enables us to show or hide the header row.

UseAccessibleHeader: It enables us to render HTML <th> tags instead of <td> tags for the cells in the header row.

Using the DataList Control:

To use this control, drag and drop the control in the design view of the web form onto a web form from the toolbox and corresponding markup will be generated automatically in the source view of a web form as following:

<asp:DataList ID=”DataList1″ runat=”server”></asp:DataList>

The Templates are as follows: 

HeaderTemplate   –  HeaderStyle

FooterTemplate   –  FooterStyle

ItemTemplate   –  ItemStyle

AlternatingItemTemplate  –  AlternatingItemStyle

EditItemTemplate   –  EditItemStyle

SelectedItemTemplate  –  SelectedItemStyle

SeparatorTemplate   –  SeperatorStyle

Events of DataList Controls:

ItemCreated: Occurs on the server when an item in the System.Web.UI.WebControls.DataList control is created.

ItemCommand: Occurs when any button is clicked in the System.Web.UI.WebControls.DataList control.

ItemDataBound: Occurs when an item is data bound to the System.Web.UI.WebControls.DataList control.

EditCommand: Occurs when the Edit button is clicked for an item in the System.Web.UI.WebControls.DataList control.

UpdateCommand: Occurs when the Update button is clicked for an item in the System.Web.UI.WebControls.DataList control.

DeleteCommand: Occurs when the Delete button is clicked for an item in the System.Web.UI.WebControls.DataList control.

CancelCommand: Occurs when the Cancel button is clicked for an item in the System.Web.UI.WebControls.DataList control.

SelectedIndexChanged: Occurs when a different item is selected in a data listing control between posts to the server.

 

 

ajax tutorial

   Introduction: Ajax is shorthand for “Asynchronous JavaScript and XML”. It is a web development technique for creating interactive web application. Ajax is a latest boom in the web development world (Either we develop web application using classic ASP, or PHP, or Servlet / JSP, or ASP.NET). Ajax can be used in these all web technologies to create interactive web applications. Ajax meant to increase the web pages interactivity, speed, and usability. Ajax can be used for creating rich web based applications that look and works like a desktop applications (Standalone application). Ajax is a group of interrelated web development techniques used on the client side to create asynchronous web applications. Ajax is of the most important technology for the development of highly interactive web application and due to its features it has become extremely popular in web development world. Ajax is not a new technology but a new way to use existing standards it is basically a web development technique which uses existing technologies like JavaScript and XML. In traditional ASP.NET web application, when user submits a form (web form), they have to wait around for the page to reload before seeing the results. With AJAX our application can dynamically populate a page (For ex. Retrieve data from a database) without having to reload the whole page. With AJAX web application can send data to and retrieve data from a server asynchronously (In the background) without interfering with the display and behavior of the existing page. Data can be retrieved using XmlHttpRequest object. AJAX uses a group of technologies such as JavaScript, XML as well as HTML, CSS, XHTML also. JavaScript is mainly used to dynamically display and to allow the user to interact with the information presented (JavaScript and XmlHttpRequest object provide a method for exchanging data asynchronously between browser and server to avoid full page reloads) AJAX can be used to make RIA (Rich Internet Application) technologies. AJAX is a web browser technology independent of web server software. AJAX Is Based On Open Standards: Browser based presentation using HTML and CSS. Data stored in XML format and fetched from the server. Data fetches using XmlHttpRequest objects in the browser. JavaScript to make everything happen (Populating dynamically data)  Prerequisites Of AJAX: HTML / CSS XHTML JavaScript / DOM  How AJAX Works: When HTML page event occurred, it is served by a proxy component. In the most recent AJAX solutions, the proxy component is based on XMLHttpRequest object. The XMLHttpRequest object sends a regular HTTP request and waits for it to be fully served. When the response data is ready, the proxy invokes a user defined JavaScript call back function to refresh any portion of the page that needs updating.  The AJAX Core Engine: The AJAX is not a particular technology it refers to a number of client features and related development techniques that make web applications look like desktop applications. AJAX does not require any plug-in. Virtually any browser released in the past five to six years can serve as great host for AJAX based applications because these all browsers have support for XMLHttpRequest object. When user makes an initial request and in response the page with the AJAX engine is loaded, there after the user sends all requests to the AJAX engine through JavaScript call back function, while the AJAX engine forwards request to the server, parses the response, and displays the HTML in the browser. XMLHttpRequest Object: The XMLHttpRequest object originally introduced with Internet Explorer with 5.0. It is an internal object that the browser publishes to its scripting engine. This object allows script code to send HTTTRequest and handle their response. The XMLHttpRequest object created by Microsoft and adopted soon thereafter by Mozilla. (This object is supported by majority of web browser today in the real world) AJAX Browser Support: All the available browsers cannot support AJAX. These are the following major browsers with support AJAX: Mozilla Firefox 1.0 and above Netscape version 7.1 and above Apple Safari 1.2 and above Microsoft Internet Explorer 5.0 and above Opera 7.6 and above. Note: When we are saying that browser does not support AJAX, it means the browser does not support creation of JavaScript object that is “XMLHttpRequest Object”. AJAX can run in on type of common browsers but there is a conflict in older (Such as IE5, IE6) and newer browsers (Such as Mozilla, Netscape, IE7+, Chrome, Safari, Opera etc). So in order to avoid this problem, we must create an object of XMLHttpRequest based on different browsers. For new browsers: var xmlhttp; xmlhttp=new XMLHttpRequest(); For older browsers: var xmlhttp; xmlhttp=new ActiveXObject(“Microsoft.XMLHTTP”); The XMLHttpRequest Object Provides Following Properties And Methods: Properties: ready State: This property returns values that indicate a current state of the object. These values from 0 to 4 during a request cycle: 0: The request is not initialised. 1: The request has been setup. (Connection established) 2: The request has been sent. (Request received) 3: The request is in process. (Request processing) 4: The request is completed. (Finished and response is ready) status: This property provides status code of the response from the server. 200: Ok 404: Page not found statusText: This property returns status message as a string. (e.g. “Page not found” or “Ok”) onreadystatechange: This property required event handler that fires when the state of the request object change. (Callback method assigned via this attribute) responseText: It holds the response data as a string of characters from the server. responseXML: It holds the response data as XML data from the server. Methods: open(mode, url, boolean): mode: Type of request either using GET or POST. url: The location of the file. Boolean: true (asynchronous), or false (synchronous). Send(“data”): This method is used to sends an HTTP request to the server and receives response. When we use to make request using GET command, then send method should be used with null parameter because data to be send via QueryString. When we used to make a request using POST command, then data to be send using send method only with specified parameter.  Readystate Property Values Of XMLHttpRequest Object To Be Used In Following Sequence: ReadyState=0: After you have created the XMLHttpRequest object but before the open() method. ReadyState=1: After you have called the open() method but the send(). ReadyState=2: After we have called the send(). ReadyState=3: After the browser has established a communication with the server but before the server has completed the response. ReadyState=4: After the request has been completed and the response data have been completely received from the server.  These Are The Following Steps Which We Follow While Writing AJAX Program: A client event occurs. An XMLHttpRequest object is created. The XMLHttpRequest object is configured. The XMLHttpRequest object makes an asynchronous request. Web server returns the result containing text or XML document. The XMLHttpRequest object calls the callback() function and the HTML DOM is updated.

c programming practice questions

c programming practice questions

What is the output of the following code? 

1.

#include<stdio.h>

main()

{

int i;

for(i=0;i<5;i++)

{

static int a=0;

int b=0;

a++;

b++;

printf(“\na=%d”,a);

printf(“,b=%d”,b);

}

return 0;

}

Ans:

a=1

b=1

a=2

b=1

a=3

b=1

a=4

b=1

a=5

b=1

2.

#include<stdio.h>

main()

{

static int s;

++s;

printf(“\n%d”,s);

if(s<=3)

main();

printf(“\n%d”,s);

return 0;

}

Ans: 1 2 3 4 4 4 4 4

3.

#include<stdio.h>

extern int a;

main()

{

printf(“\na=%d”,a);

return 0;

}

Ans: Linking Error undefined symbol _a

4.

#include<stdio.h>

int a;

main()

{

printf(“\n a = %d”,a);

return 0;

}

Ans: a=0

5.

#include<stdio.h>

extern int a;

main()

{

printf(“\n a = %d”,a);

return 0;

}int a;

Ans: a=0

6.

#include<stdio.h>

extern int a;

main()

{

printf(“\n a = %d”,a);

return 0;

}

int a=5;

Ans: a=5

7.

#include<stdio.h>

extern int a=5;

main()

{

void fun();

printf(“\n a = %d”,a);

fun();

return 0;

}

int a;

void fun()

{

printf(“\n in fun a = %d”,a);

}

Ans: a=5,a=5

8.

#include<stdio.h>

extern int a;

main()

{

void fun();

printf(“\n a = %d”,a);

fun();

return 0;

}

int a=7;

void fun()

{

printf(“\n in fun a = %d”,a);

}

Ans: a=7,a=7

9.

#include<stdio.h>

extern int a=5;

main()

{

void fun();

printf(“\n a = %d”,a);

fun();

return 0;

}

int a;

void fun()

{

printf(“\n in fun a = %d”,a);

}

Ans: a=5,a=5

10.

#include<stdio.h>

void fun(int _)

{

printf(“%d”,_);

}

main()

{

fun(23);

return 0;

}

Ans: 23

11.

#include<stdio.h>

main()

{

auto a;

register r;

static s;

extern e;

printf(“\n%d”,sizeof a);

printf(“\n%d”,sizeof r);

printf(“\n%d”,sizeof s);

printf(“\n%d”,sizeof e);

return 0;

}

Ans: 2 2 2 2

Identify the compiler error in the following code?

#include<stdio.h>

void fun(auto int _)

{

printf(“%d”,_);

}

main()

{

fun(23);

return 0;   }

Ans: Error

Identify the compiler error in the following code?

#include<stdio.h>

void fun(static int _)

{

printf(“%d”,_);

}

main()

{

fun(23);

return 0;

}

Ans: Error

Identify the compiler error in the following code?

#include<stdio.h>

void fun( extern int _)

{

printf(“%d”,_);

}

main()

{

fun(23);

return 0;

}

Ans: Error

Identify the compiler error in the following code?

#include<stdio.h>

void fun(register int _)

{

printf(“%d”,_);

}

main()

{

fun(23);

return 0;

}

Ans: 23

Identify the compiler error in the following code?

#include<stdio.h>

void fun(typedef int _)

{

printf(“%d”,_);

}

main()

{

fun(23);

return 0;

}

Ans: Error

Identify the error in the following code?
static extern

int a=5;

static int b = 6;

main()

{

printf(“\n%d”,a); printf(“\n%d”,b);

return 0;

}

Ans: 5 6
Identify the error in the following code?

#include<stdio.h>

main()

{

extern int a=5;

printf(“\n %d”,a);

return 0;

}

Ans: 5

Is it possible to declare static function in c language?

Ans: yes it become file scope function

Can we return more than one value by using return statement?

Ans: No

How to return more than one value from a function?

Ans: call by address

Can we use more than one return statement in one function?

Ans: yes

Give an example for function returning void but contains return statement?

Ans:

void abc()

{

printf(“Hello abc”);

return;

}

void main()

{

abc();

}

What is the differences between K&R C style and ANSI C style?

Ans:

K&R-C

int sum(a,b) int a; int b;

{

return (a+b);

}

ANSII-C

int sum(int a,int b)

{

return (a+b);

}

Write a small ‘c’ function to receive any number of arguments?

array program in c

/*writer array  program in c  to accept elements in two single dimension 2D array  and add them into third array */

 

# include<stdio.h>
main()
{
	int arr1[5], arr2[5], arr3[5];
	int i=0;
	printf("\n Enter elements for first array");
	for(i=0;i<=4;i++)         // First for loop to accept first array elements.
	{
		printf("\nEnter number:");
		scanf("%d",&arr1[i]);
	}
	printf("\n Enter elements for second array");
	for(i=0;i<=4;i++)    	// Second for loop to accept second array elements
	{
		printf("\nEnter number:");
		scanf("%d",&arr2[i]);
	}
	printf("\n addition stored in third array");
	for(i=0;i<=4;i++)      // Third for loop to add elements of array into third.
	{
		arr3[i]=arr1[i]+arr2[i];  // Putting added elements of arr1 and arr2 into arr3 at ith location.
		printf("\n arr3[%d]=%d ",i, arr3[i]);
	}
	getch();
}

 

write a array program in c to add and subtract two 3X3 matrices

# include<stdio.h>
main()
{
	int arr1[3][3], arr2[3][3];
	int arradd[3][3], arrsub[3][3];
	int i=0,j=0;
	clrscr();
	printf("\n Enter elements of first array\n");
	for(i=0;i<=1;i++)
	{
		printf("\n");
		for(j=0;j<=2;j++)
		{
			printf("Enter arr[%d][%d]:\t", i,j);
			scanf("%d", &arr1[i][j]); // Accepting array elements for first array arr1.
		}
	}
	printf("\n Enter elements of second array\n");
	for(i=0;i<=2;i++)
	{
		printf("\n");
		for(j=0;j<=2;j++)	 	// Accepting array elements for second array arr2.
		{
			printf("Enter arr[%d][%d]:\t", i,j);
			scanf("%d", &arr2[i][j]);
		}
	}
	for(i=0;i<=2;i++)
	{
		for(j=0;j<=2;j++)
		{
			arradd[i][j]=arr1[i][j]+arr2[i][j];	

			arrsub[i][j]=arr1[i][j]-arr2[i][j];	
		}
	}
	printf("\n Addition of two matrices\n\n");
	for(i=0;i<=2;i++)
	{
		for(j=0;j<=2;j++)
		{
			printf("arradd[%d[%d]=%d\t", i, j, arradd[i][j]); 	
		}
		printf("\n");
	}
	printf("\n Subtraction of two matrices\n\n");     
	for(i=0;i<=2;i++)
	{
		for(j=0;j<=2;j++)
		{
			printf("arradd[%d[%d]=%d\t",i,j,arrsub[i][j]);   	
		}
		printf("\n");
	}
	getch();
}

 

Using ASP.NET To Send Email

Email is a standout amongst the most well-known and dependable strategies for correspondence for both individual and business purposes. It likewise assumes an essential part in every last Web website. This part will be in the sort of computerized messages from the server in the wake of posting data from a shape. You may have seen these sorts of messages while enrolling on a site. When you post the shape, the server will send an email requesting that you affirm either your enlistment or with the data you entered. On the off chance that you need to affirm the enrollment, the server will send you a long URL that you need to snap to continue encourage with the enlistment procedure. A great case of this usefulness is ASP.NET discussions. When you enlist, you will be messaged an irregular secret key. You will likewise get messages after your post has been acknowledged by an arbitrator or on the off chance that some individual answers to your post. On the off chance that you are pondering this is a server enchantment—it isn’t. The entire procedure is influenced conceivable with the assistance of server-to side programming structure, for example, ASP and ASP.NET.

To send messages, you ought to expect access to a server with .NET Framework and SMTP empowered on it. SMTP remains for Simple Mail Transfer Protocol and messages are sent utilizing this convention.

The .NET Framework supplies a SMTP class that empowers you to send a straightforward email message. In the event that you need to send an email with included functionalities, you need to make utilization of the MailMessage class. With the assistance of this class, you can include connections, set needs, and substantially more, effortlessly. You can likewise send HTML email utilizing this class.

Luckily, ASP.NET makes sending email a breeze. The .NET Framework adaptation 1.x incorporated various classes in the System.Web.Mail namespace that permitted automatically sending an email with a couple of sparse lines of code. While this namespace and these classes still exist in the .NET Framework rendition 2.0, they have been deplored for new mail-related classes found in the System.Net.Mail namespace.

In order to send an email from an ASP.NET Web page, we need to use the SmtpMail class found in the System.Web.Mail namespace, which contains a static method Send(). OR In order to send an email from an ASP.NET Web page, we need to use the SmtpClient class found in the System.Net.Mail namespace, which contains a method Send(). SmtpMail Class Provides properties and methods for sending messages using the Collaboration Data Objects for Windows 2000 (CDOSYS) message component. Recommended alternative: System.Net.Mail.
SmtpClient Class allows applications to send e-mail by using the Simple Mail Transfer Protocol (SMTP).

Advantages of Using ASP.NET To Send Email

There are several advantages to using ASP.NET to send email:

  • Easy to use: ASP.NET provides a simple and straightforward way to send email, using the System.Net.Mail namespace. Developers can easily create and send email messages, including HTML emails with attachments.
  • Reliable: ASP.NET uses the Simple Mail Transfer Protocol (SMTP) to send email, which is the standard protocol used by email servers around the world. This makes ASP.NET emails more likely to be delivered successfully.
  • Secure: ASP.NET provides a number of security features to help protect email messages from being intercepted or tampered with. For example, ASP.NET can encrypt email messages and use SSL/TLS to secure communication with the SMTP server.
  • Scalable: ASP.NET can be used to send email to large numbers of recipients without performance problems. This makes it a good choice for sending email newsletters and other marketing campaigns.

application state in asp.net

what is application state in asp.net

Application state in asp.net is a server side state management technique.

The date stored in application state is common for all users of that particular ASP.NET application and can be accessed anywhere in the application.

It is also called application level state management. ASP.NET provides application state via the HttpApplicationState class as a method of storing global application-specific information that is visible to the entire application.

Application-state variables are, in effect, global variables for an ASP.NET application.

We can store our application-specific values in application state, which is then managed by the server.

Data that is shared by multiple sessions and does not change often is the ideal type of data to insert into application-state variables.

Application state is a data repository available to all classes in an ASP.NET application. Application state is stored in memory on the server and is faster than storing and retrieving information in a database. Unlike session state, which is specific to a single user session, application state applies to all users and sessions. Therefore, application state is a useful place to store small amounts of often-used data that does not change from one user to another.

Application State is used to store information which is shared among users of the ASP.Net web application. Application state is stored in the memory of the windows process which is processing user requests on the web server. Application state is useful in storing a small amount of often-used data. If application state is used for such data instead of frequent trips to the database, then it increases the response time/performance of the web application.

If the information that you want to be accessed or stored globally throughout the application, even if multiple users access the site or application at the same time, then you can use an Application Object for such purposes.

“A global storage mechanism that is accessible from all pages in the Web application. Application state is stored in the Application key/value dictionary. This information will also be available to all the users of the website.”

Advantages of using application state in asp.net :-

 Simple implementation: Application state is easy to use, familiar to ASP developers, and consistent with other .NET Framework classes.

  Application scope: Because application state is accessible to all pages in an application, storing information in application state can mean keeping only a single copy of the information (for instance, as opposed to keeping copies of information in session state or in individual pages).

Disadvantages of using application state in asp.net :-

 Application scope:   The scope of application state can also be a disadvantage. Variables stored in application state are global only to the particular process the application is running in, and each application process can have different values. Therefore, you cannot rely on application state to store unique values or update global counters in Web-garden and Web-farm server configurations.

 Limited durability of data:   Because global data that is stored in application state is volatile, it will be lost if the Web server process containing it is destroyed, such as from a server crash, upgrade, or shutdown.

Resource requirements:   Application state requires server memory, which can affect the performance of the server as well as the scalability of the application.

Variables in PHP

variable in php

Variable  is  name of memory location   used  to store some  data.

In PHP no need  to provide  data types at the   time of variable  declaration because  PHP is loosely types   language .

Variable names start  with  ‘$’ symbol.

types of variable in PHP

 

Local variable :-

Variable declaration within  the  function comes under local variable .

Local variable of  a function cannot  be accessed  from another  function.

Global variable :-

Variable declaration outside  of  all function  come under global variable.

Global variable  can be accessed from any function within the script.

Note:-  We  can not access global variables directry from function by using ‘$’ GLOBALS  keyword.  We can access global variable by using  ‘$ GLOBALS’ key from functions.

Variable  variables :-

If we assign a variable name as the value of another variable comes under  variable variables ,

Static variables :-

Static variable can remember previous value . we can assign value only  one time into static variable.

Reference variable  :-

It is an alias name of a variable . both refers the value of same address locations.

Super Global variable :

PHP support no of super global variable . these variable we can access from any  web page in application. All super global variables are array data types available

Scalar data types in php

In php four data types

  1. Boolean
  2. Integer
  3. Float
  4. String
Boolean data type in php

This data type can represent either true or false . In PHP value is 1 and value of false doesn’t any value.
is_bool : Using this function , we can check input variable is boolean or not.
(bool) var  OR  (boolean) var     using this function , we  convert variable into boolean variable.

Integer data type in php

This data type can store numeric value
is_int  OR  is_integer    it is used to  cheak input variable is integer or not .
(int)var ))OR  (integer) var  OR intval(var)    Using this function , we convert variable into integer variable.

Float data type in photo

this  data type  can store decimal values .

is_float ()  this function cheacks input variuable  is float or not.
(float)var   Converts a variable into floating point number.

String data type in php

It is a collection of character.
In PHP , we can declar string in  three ways.

  1.    By using single quotations
  2.    By using double quotations
  3.    By using heredoc syntax

NOTE  Variable in double quotations returns value of variables.

Heredoc   PHP suports heredoc  syntax to avoid the conflicts what we getting with single and double quotations.


Compound data types