Rate my solution and please do comment if any doubt
I have clearly stated every code and its output
Don't forget to host the file before opening in the browser
1 Code:
<!DOCTYPE html>
<html>
<head>
<title>PHP info</title>
</head>
<body>
<?php
phpinfo();
?>
</body>
</html>
1 Output:

2 Code:
<!DOCTYPE html>
<html>
<head>
<title>CHECK ODD or EVEN</title>
</head>
<body>
<table border="1">
<tr>
<th>NUMBER</th>
<th>RESULT</th>
</tr>
<?php
//below loop
will traverse from 1 to 100
for($i=1;$i<=100;$i++)
{
//If is is divisble by 2 then it is even
if($i%2==0)
echo "<tr>
<td>$i</td>
<td>EVEN</td>
</tr>";
//If is is not divisble by 2 then it is
odd
else
echo"<tr>
<td>$i</td>
<td>ODD</td>
</tr>";
//here i am printing the row and cells $i and
its type(odd or even)
}
?>
</table>
</body>
</html>
2 Output:

3 Code:
<!DOCTYPE html>
<html>
<head>
<title></title>
</head>
<body>
<?php
//$arr is the array declaration with its keys and
values
$arr=array("A"=>4,"B"=>3,"C"=>1,"D"=>2,"E"=>8,"F"=>7,"G"=>6,"H"=>5);
//var_dump() will define the data type of the keys and
values
var_dump($arr);
//Table starts here
echo "<table border='1'>";
//below is the table heading
echo
"<tr><th>KEY</th><th>VALUE</th></tr>";
//each key and value is take from $arr and added to
the table
foreach($arr as $x => $x_value)
{
echo
"<tr><td>$x</td><td>$x_value</td></tr>";
}
echo "</table>";
//The array is sorted based on values
asort($arr);
var_dump($arr);
//var_dump() will define the data type of the keys and
values
echo "<br>";
//unsetting the value of "B" below will remove "B"
from the arry
unset($arr["B"]);
var_dump($arr);
//var_dump() will define the data type of the keys and
values
?>
</body>
</html>
3 Output:
![array(8) { [A]=> int(4) [B]=> int(3) [C]=> int(1) [D]=> int(2) [E]=> int(8) [F]=> int(7) [G]=> int(0) [H]=> i](http://img.homeworklib.com/questions/ba5cf460-97ba-11ea-aced-f9d009ae92d5.png?x-oss-process=image/resize,w_560)
4 Code:
<!DOCTYPE html>
<html>
<head>
<title></title>
</head>
<body>
<?php
$arr=array("joeDoe"=>array("tweets"=>20000,"followers"=>45,"following"=>8),
"JohnD"=>array("tweets"=>62000,"followers"=>123,"following"=>160),
"computerSavy"=>array("tweets"=>75,"followers"=>1,"following"=>25),
"myTwitterAccount"=>array("tweets"=>1800,"followers"=>15,"following"=>6)
);
//it is the array of users
//table tag starts here
echo "<table
border='1'>";
echo "<tr><th>User
name</th>
<th>Tweets</th>
<th>No. of followers</th>
<th>Following</th>
</tr>";
//table headings are given
above
//below loop will take each element
from $arr
//Key and its value is taken form
arr
foreach ($arr as $key => $value)
{
echo
"<tr>
<td>$key</td>";
//as the value comtains other info about
user
//we have to traverse through it
foreach ($value as $s_key => $s_value)
{
echo "<td>$s_value</td>";
}
echo
"</tr>";
}
echo "</table>";
//asort will sort the array $arr on
the basis of the second argument(tweets)
asort($arr,$arr["joeDoe"]["tweets"]);
//The same as of above table is
printed here
echo "<h1>Sorted
Array:</h1><table border='1'>";
echo "<tr><th>User
name</th>
<th>Tweets</th>
<th>No. of followers</th>
<th>Following</th>
</tr>";
foreach ($arr as $key => $value)
{
echo
"<tr>
<td>$key</td>";
foreach ($value as $s_key => $s_value)
{
echo "<td>$s_value</td>";
}
echo
"</tr>";
}
echo "</table>";
?>
</body>
</html>
4 Output:

1. Print out information of PHP use phpinfo() function. 2. Write a program that check and...
Write a program that check odd / even numbers (from number 1 to
100). Display the results within an HTML table with 2 columns: one
for odd number and one for even numbers.
NUMBERS RESULTS ODD EVEN ODD 2 HINT: use <table> tags to create a table, <th> tags for 'Numbers' and 'Results'. Wrap code PHP inside HTML code. For example: <html> <title>CHECK ODD or EVEN</title> <body> <table> ?php echo "<tr><td>l</td><td>Odd</td</tr>"; </table> </body </html 2. Do the following steps in...
Write a PHP program using a ''FOR loop' to compute and print the employee's salary for some number of years with a percent increase each year. Your submit button should re-call this page and use PHP to create a table of salaries for each year starting at 1 up to the value of the years variable. So if 'years' is equal to 5, there should be 5 rows in your table. For each year, the salary increases by X%. Make...
Write a web program to allow the user to sort a list of things. Use HTML and PHP. Your input (HTML) should include a text area the user can type in their list. The output (PHP) should be in the form of a table. Use the explode command to break the input up into an array. $list=explode(PHP_EOL, $stuff); Once you have the text into an array, use the sort function to sort it, and then loop through it and print...
Q1. rewrite the exercise on April 4 by adding the
following operations:
1) In the php script, create an associative array named
$order that stores the following values:
- the number of cheese toppings;
- the number of pepperoni toppings;
- the number of
ham
toppings;
- the size of the ordered pizza;
- the number of the ordered pizza;
- the total cost of the order;
- the discount rate;
- the total cost after the discount.
2) the...
Use php Create a file to write a program of 30 city name and populations Using two files Print using associative array Output should be like Cities: Name. Population Daka. 13 millions
This code should be written in php. Write a program that allows the user to input a student's last name, along with that student's grades in English, History, Math, Science, and Geography. When the user submits this information, store it in an associative array, like this: Smith=61 67 75 80 72 where the key is the student's last name, and the grades are combined into a single space-delimited string. Return the user back to the data entry screen, to allow...
In Java*
Write a program that reads an arbitrary number of 20 integers that are in the range 0 to 100 inclusive. The program will ask a user to re-enter an integer if the user inputs a number outside of that range. The inputted integers must then be stored in a single dimensional array of size 20. Please create 3 methods: 1. Write a method public static int countEven(int[] inputArray) The method counts how many even numbers are in...
In Python! Create the program that print out only odd numbers 1,3,5,7,9 Use either a while loop or a for loop to print only odd numbers 1, 3, 5, 7, 9 *tip: you can use range () function, or a condition with ‘break’ (e.g, while count < 10) In python!: Create a program that print out 12 months of a year and associated numbers (e.g., January 1, February 2…). Two lists should be created, and then loop through the list...
1.Write a PHP function that generates a random email. 2.Write a PHP function that generates a random password given the length as a parameter. 3. Run a query that will generate a database named lab4 b. 4.Run a query that will create a table named users, the table will only have three columns, email TEXT and password TEXT, ID INTEGER NOT NULL AUTO_INCREMENT. ID will be the primary key that will be generated for us automatically based on the record...
Write a C program to do the following 1) request user to enter 10 integer into an array 2) sort the array in ascending order 3) display the sorted array 4) count the number of odd and even number in the array and print out the result 5) add the value of the odd number and even number and calculate the average of the odd and even number. display the result 6) write function addNumber() to add all the number...