UNIT 4
UNIT 4
var myVariable
=myVariable
variable myVariable
int myVariable
variable
=variable name
variable name
variable name
Global variables are only accessible within functions in which they are declared
Global variables are accessible only within the function they are declared
=global myVariable
use myVariable
external myVariable
import myVariable
=NULL
false
undefined
=strlen()
length()
size()
strsize()
7.Which PHP function is used to check if a variable is set and is not NULL
=isset()
isnull()
defined()
notnull()
}
8.What does the empty() function do in PHP
9. Which built-in function can be used to round a floating-point number to the nearest integer in
PHP
=round()
ceil()
floor()
int()
is_email()
validate_email()
=filter_var()
check_email()
is_null()
=empty()
is_empty()
check_empty()
}
13.Which function can be used to strip tags from a string to prevent HTML injection in PHP
=strip_tags()
remove_tags()
anitize_string()
clean_string()
is_integer()
validate_integer()
=filter_var()
check_integer()
15.Which PHP function is used to trim whitespace from the beginning and end of a string
{
=trim()
strip()
clean()
remove()
{
<123element>
<element-name>
<element name>
<element@name>
18.What is the purpose of the XML declaration at the beginning of an XML document
<root>
<document>
<xml>
=There is no specific element; the root element is simply the first element in the document
}
20.What is an XML attribute used for
=DTD is used for defining the structure of XML documents, while XML Schema also supports data
types and more complex validations
XML Schema is used for styling XML data, while DTD defines the document's structure
{
<xs:element>
<xs:complexType>
=<xs:simpleType>
<xs:attribute>
24. How do you define an element with optional occurrence in XML Schema
=Using minOccurs=0
Using optional=true
sing occurrence=none
Using occurs=0
25.Which of the following XML Schema elements is used to define an attribute for an element
=<xs:attribute>
<xs:element>
<xs:complexType>
<xs:simpleType>
=To read and interpret XML documents according to the XML standard
=SAXParser
XMLParser
DOMParser
JSONParser
29.Which XML parsing method reads XML documents in a forward only manner
DOM
=SAX
XSLT
XQuer
=To transform XML documents into different formats like HTML or plain text