[SOLVED] CS213- Lab 4 : PHP1 part 1 statement

20.00 $

Category:

Description

Rate this product

In this lab you will learn to use PHP

Please create a directory called “rollno-lab4-part1” where “rollno” is your roll number.

Keep all your scripts, html pages and all relevant files in this directory Use following command to create a tar ball :

tar -czvvf rollno-lab4-part1.tgz rollno-lab4-part1/

Upload this tarball “rollno-lab4-part1.tgz” on moodle.

Do not change cases, and do not deviate from the naming scheme for your scripts, directory or tar file to be uploaded.

  1. Finding k-th smallest number:

Take some integers from the command line as input.

First element is parameter k.

Print the k-th smallest number.

Validate your input: For example if we feed strings instead of numbers your program should print a custom message, and in which argument it has occurred.

(A file called e2.php is given where such error handling is shown, in addition to an example given in the demos.)

(A file called argv.php has example showing how to access command line arguments in PHP).

(name of your file should be q1.php).