The only helpbook you’ll need to learn about Delhi University ( DU)
This is the question bank developed by faculties in Centre for Environmental Engg. of PRIST University for the Environmental Science for B.Tech. course, as per UGC Syllabus.Full description
For All JIPMER Previous Year Solved Question Papers visit: http://admission.aglasem.com/jipmer-mbbs-previous-year-solved-question-paper/Full description
For All JIPMER Previous Year Solved Question Papers visit: http://admission.aglasem.com/jipmer-mbbs-previous-year-solved-question-paper/Full description
NSEC question paper with Answers
For All JIPMER Previous Year Solved Question Papers visit: http://admission.aglasem.com/jipmer-mbbs-previous-year-solved-question-paper/Full description
For All JIPMER Previous Year Solved Question Papers visit: http://admission.aglasem.com/jipmer-mbbs-previous-year-solved-question-paper/Full description
Central Board of Secondary Education (CBSE) Board Examination Question Papers for Class 12 for Biology Subject. For All CBSE Board Question Papers for Class 12 of 2014 Year visit: http://schools...
Central Board of Secondary Education (CBSE) Board Examination Question Papers for Class 12 for Chemistry Subject. For All CBSE Board Question Papers for Class 12 of 2014 Year visit: http://schoo...
Central Board of Secondary Education (CBSE) Board Examination Question Papers for Class 12 for Maths Subject. For All CBSE Board Question Papers for Class 12 of 2014 Year visit: http://schools.a...
These are section -2 notes for university of delhi students mathematics hons semester 2. these notes contain solved questions on uniform continuity of a function. and theoretical part of c…Full description
Question Paper with Solution
JLPT Question paperFull description
JLPT Question paperDescripción completa
JLPT Question paperFull description
NIDFull description
kinematics questionsFull description
FTII ENTERENCE
PACE IITFull description
good samplesFull description
practical sample question paper for practice
CP7019-Managing Big Data-Anna University -Question Paper
Acharya Narendra Dev College Computer Science (Hons.) PHP Assignment Submitted by: Sachin Rana X-1255 Section A 1. (a) Question: Give the output.
$a=100; echo $++a." ".$a++; Ans: Output will be: 101 101. (b) Question: State whether the following statement is True or False: "Function name in PHP is case sensitive" Ans: False (Only variables names are case sensitive). (c) Question: What is the role of "<>" operator? Give an example showing how it can be used as a ternary operator. Ans: "<>" is used for checking "Not Equal to" condition. Example: a<>b? a: b (d) Question: Which of the two are valid variable names, why? (i) $current_user (ii) $current-user Ans: $current_user is valid variable name because we can only use “_” symbol in variable name naming convention.
(e) Question: Find and correct the error in following code.
Ans: There is error in variable $my_string value as we can‟t use single apostrophe in between string like that because it will close string there only so we have to use backslash „\ „ \‟ before apostrophe.
don\ t know.‟ Correction: „They don\ ’
(f) Question: Describe implode() and explode() function with the help of an example. Ans:
(i) implode(): The implode() function returns a string from elements of an array. It takes an array of strings and joins them together into one string using a delimiter (string to be used between the pieces) of your choice. Example: $arr = Array ("h","e","l","l","o" ); $str = implode ("-",$arr) ; echo $str; Output: h-e-l-l-o
(ii) explode(): The explode function is used to "Split a string by a specified string into pieces i.e. it breaks a string into an array". The explode function in PHP allows us to break a string into smaller text with each break occurring o ccurring at the same symbol. This symbol is known as the
delimiter. Using the explode command we will create an array from a string. The explode() function breaks a string into an array, but the implode function returns a string from the elements of an array. Example: We have a string $str="hello"; Now you want to make each name n ame as an element of an array and access it individually so what do you do
$arr=explode (",", $str); means we have made pieces of string $text based on separator ',' and put the resulting array in variable $arr. So we used print_r ($arr); and the results are the following: Array([0]=>h[1]=>e[2]=>1[3]=>1[4]=>=>o) which is equal to: $arr = Array ("h","e","l","l","o"); (g) Question: Create an associative array for the following data. one, 1 two, 2 three, 3 Ans: $count array("one"=>"1","two"=>"2","three"=>"3"); Section B 2. (a) Question: Give the built function names to (i) Sort a numeric array (ii) Reverse sort a numeric array (iii) Sort an associative array based on the key (iv) Sort an associative array based on the values.
(i) sort() (ii) rsort() (iii)ksort() (iv) asort() Ans: (b) Question: Write a PHP code to find and replace all the occurrences of $sub=”to” in the string $mystr=”into onto and unto”.
Ans:
(c) Question: Describe the working of the following code:
Question 2 a Gender: value=”female”>Female
value=”male”>Male Ans: Output: Gender: Female
Male
In this we set the web-page title as Question 2a and the we give here two radio buttons for Gender as Male and Female. When we select any of the radio button in this it will print a message as checked.
3. (a) Question: What is a Query String? Explain with an example. Ans: The information which is passed across the web pages is called Query String. This query string can be passed from one page to another by appending it to the address of the page. A query string can contain two things: the query string ID and its value. The query string passed across the web pages is stored in $_REQUEST, $_GET, or $_POST variable. Whether we passed the query string by using GET or POST method, it is stored in $_REQUEST variable. If we want to access the query string you can use these variables. We should note that whether the query string is passed by the GET or POST method it can be accessed by using the $_REQUEST $_REQUES T variable. If we want to use $_GET $_G ET variable to access the query string the form method need to be GET. Also, we can use $_POST variable to get the query string if the form method is POST. Example: The query strings username and email (the names of textboxes) are passed from a page called to another page called when we click the submit button. .loginphp .startphp Login.php:
Login form start.php: Welcome".$_GET[„ echo"Welcome".$_GET [„username']." "; username']." "; echo "Please remember this e-mail: ".$_GET ['email']. " for registration purpose."; ?> (b) Question: What is a session? Write a code snippet to start a session and create a session variable. Ans: Session: A session is a way to store information (in variables) to be used across multiple
pages. Unlike a cookie, the information info rmation is not stored on the user‟s computer it is stored on the servers. When you work with an application, you open it, do some changes, and then you close it. This is much like a Session. The computer knows who you are. It knows when you start the application and when you end. But on the internet, there is one problem: the web server does not know who you are or what you do, because the HTTP address doesn't maintain state. Session variables solve this problem by storing user u ser information to be used across multiple pages (e.g. username, favourite favou rite color, etc). By default, session variables last until the user closes the browser. So, Session variables hold information about one single user, and are available to all pages in one application. Starting a PHP Session and creating session variables Code Snippet: 4. (a) Question: Give the syntax to pass and capture the variable between the PHP webpages during du ring navigation. Ans: link to page2
When the above link is clicked, page2.php gets the variables id and user with data 2489 and tom respectively. Here is the code to collect data in PHP. echo $_GET ['id'] ; //output 2489echo $_GET[ 'tom'] ; // output tom The address of page2.php can be replaced with any site name and the same data can be passed to another site running in any server.
(b) Question: Write a function in PHP which takes email address as an input and returns username and domain name in an associative array. Ans:
"; echo "Your Email is: ". $_POST ["email"] . " "; echo "Your Mobile No. is: ". $_POST[ "contact"] ;
} ?> 5. (a) Question: When is the variable $_SERVER[„PHP_SELF‟] used? Give an example. Ans: PHP_SELF is a super global variable that returns the current script being executed. This variable returns the name and path of the current file. A common use u se of PHP_SELF variable v ariable is in the action field of the