||~R_girl~||

Member
Mar 21, 2008
34,536
460
0
and anyone know this?
it doesnt even make any sense to me ;S
Write a PHP script to create an array named employee_salary. The keys of the array
are names of employees and the values are their salaries. Use the asort function to sort
the array according to the salary of the employees. Then use the ksort function to sort
the array by the names of the employees. Use the foreach statement to output the keys
and values of the array before and after sorting.
Exercise 4
Re-do exercise 3, but this time write your own sorting functions. Specifically, write
my_asort() and my_ksort() that do exactly the same as asort and ksort respectively.
 

||~R_girl~||

Member
Mar 21, 2008
34,536
460
0
and here's another Q. i know this is too much to ask for.. so im not even expecting an answer from anyone for this one lol
just posting

Write the XHTML code to create a form with the following capabilities:
1. A text widget to collect the user’s name
2. Four checkboxes, one each for the following items
a. Four 100-watt light bulbs for $2.39
b. Eight 100-watt light bulbs for $4.29
c. Four 100-watt long-life light bulbs for $3.95
d. Eight 100-watt long-life light bulbs for $7.49
3. A text widget to collect the number of battery packs ordered by the user at the
price of $10.42 each.
4. A collection of three radio buttons that are labelled as follows:
a. Visa
b. MasterCard
c. AmericanExpress
Then write a PHP script that computes the total cost of the ordered light bulbs and
battery packs after adding 17.5 percent VAT. The program must inform the buyer of
exactly what was ordered in a table, and what credit card was chosen to make
payment.
 

smother

Well-known member
  • Jan 27, 2009
    19,902
    1,483
    113
    36
    Six Feet Under
    okay this is the question:



    should this be done in if and else statement? i mean i just dont get the whole thing how to do it...


    function getBrowser()
    {
    $u_agent = $_SERVER['HTTP_USER_AGENT'];
    $ub = '';
    if(preg_match('/MSIE/i',$u_agent))
    {
    $ub = "Internet Explorer";
    }
    elseif(preg_match('/Firefox/i',$u_agent))
    {
    $ub = "Mozilla Firefox";
    }

    elseif(preg_match('/Chrome/i',$u_agent))
    {
    $ub = "Google Chrome";
    }

    return $ub;
    }

    try this
     

    sanzilla jackcat

    Well-known member
  • Oct 3, 2008
    6,757
    3,343
    113
    ෆ්ලුජා නගරය

    sanzilla jackcat

    Well-known member
  • Oct 3, 2008
    6,757
    3,343
    113
    ෆ්ලුජා නගරය

    mldarshana

    Well-known member
  • Apr 2, 2007
    34,059
    1,404
    113
    ආශ්චර්ය අභියස :nerd:
    okay this is the question:



    should this be done in if and else statement? i mean i just dont get the whole thing how to do it...

    PHP:
    $browser = $_SERVER['HTTP_USER_AGENT'];
    
    if (preg_match('/MSIE/i',$browser)) {
        echo "you are using Microsoft Internet Explorer";    
    } else if (preg_match('/Firefox/i',$browser)) { 
        echo "you are using Firefox";    
    } else if (preg_match('/Chrome/i',$browser)) {
        echo "you are using Chrome";    
    }
     

    ||~R_girl~||

    Member
    Mar 21, 2008
    34,536
    460
    0
    PHP:
    $browser = $_SERVER['HTTP_USER_AGENT'];
    
    if (preg_match('/MSIE/i',$browser)) {
        echo "you are using Microsoft Internet Explorer";    
    } else if (preg_match('/Firefox/i',$browser)) { 
        echo "you are using Firefox";    
    } else if (preg_match('/Chrome/i',$browser)) {
        echo "you are using Chrome";    
    }

    ohh yeahh this is working... thank u soooo much