Partial preview of the text
Download Engineering Dynamics Facts and more Assignments Engineering Dynamics in PDF only on Docsity!
= Qstudocu Search tor enim, hooks or cocuiment a pen Fisse eb Share ‘Wan this document helpful? 1. Solve following que $color = array('white!, ‘green, ved hue! "aac sky) eo no ‘Write & seript which will display dhe following sting Expected Output: "rhe mamory of thar scene for me is ike a frame of film forever frozen ar that ‘moment: the red carpet, the green lawn, the white house, the Teaden sky. ‘The new president and his first lady.- Richard M. Nixon" and the words ‘red’, ‘green, ‘sky’ and ‘white! will come from Scolar 2. Write a PHP script which wil display the colors in the following way : Scolar = array(‘white, ‘green’, red") Expected Output : a) white, green, ced, » sgreen red swhite 3. Create a PHP seript which displays the capital and counury same from ue below array Slist Slise = array "N > "Sydney", Deum: "slovak Spain'=>"Medria!) ; Sort the list by the expital of Lhe country: Surmple Output The capital of Nepal is Kathmandu Ihe capital of India is New Delhi The capital of Australia is Sydney and saan 4. $s = array(1, 23,4, 5); Delete su ulement from the above PHP erray. Alter deleting dhe elesment, inleger keys aust ye narmalired Expected Output : First : array(3) { [0]=> int(1) [=> int(2) [2]—> ine(3) (8]—> ines) [4] => inn) F Afier Delete : array(4) { [0]—> int(1) [1]—> int(2) [2]—» int) [3]-> iau(S) } 5. Write a PLIP script that inserts a new item in an array in any position, "31"Hari=>"411/'Sita" => "39" "Gira =>"40) in a) ascending order sort by value +b) ascending order sort by Key 6} descending onder sorting by Value d) descending order sarting hy Key 7. Write a PHP script to caleulate and display average weigh, ve lowest andl highest sweighrs Recareled weigt *50,60,70,90.4 0,61,02,08,04" 50,57,58,59.6 8. Write a PHP function to change the following array’s all values to npper ar lower case: Sample urrays: