##########################################
#
# PHP (2): In class exercise
#
##########################################
####################################################
# ALL OF THE FILES SHOULD BE SAVED AS .php
# Try to add enough comments in your code.
####################################################
###### Question No. 1 ##################################################
####################################################
#
# Consider you have the following text: $24,555.00
#
# Use the appropriate string manipulation
# commands to change it to : 24,555
#
# Tip: Use the trim command
#
####################################################
Please visit: q1.php
Please visit: q1.txt
###### Question No. 2 ##################################################
####################################################
#
# Consider you have the following text: $24,555.00
#
# Use the appropriate string manipulation
# commands to change it to : $24,555
#
# Tip: Use the rtrim command
#
####################################################
Please visit: q2.php
Please visit: q2.txt
###### Question No. 3 ##################################################
####################################################
#
# Consider you have the following text: HELLO WORLD!
#
# Use the appropriate string manipulation
# commands to change it to : Hello World!
#
# Tip: Use the ucwords command
#
####################################################
Please visit: q3.php
Please visit: q3.txt
###### Question No. 4 ##################################################
####################################################
#
# Consider you have an array consisting of the
# following elements: peter, mark and robin
#
# Try to change the array to: Peter, Mark and Robin
#
# Tip: Use the ucfirst command
#
####################################################
Please visit: q4.php
Please visit: q4.txt
###### Question No. 5 ##################################################
####################################################
#
# Consider you have an array consisting of the
# following elements: Peter, 48 and Halifax
#
# Try to change the array to a string containing:
# Peter/48/Halifax
#
# Tip: Use the impolde command
#
####################################################
Please visit: q5.php
Please visit: q5.txt
###### Question No. 6 ##################################################
####################################################
#
# Consider you have the following text: $24,555.00
#
# Use the appropriate string manipulation
# commands to change it to : 24555
#
# Tip: Use the substr command
#
####################################################
Please visit: q6.php
Please visit: q6.txt
###### Question No. 7 ##################################################
####################################################
#
# Show how much is the length of the folowing
# string: "The lab information is ready."
#
# Tip: Use the strlen command
#
####################################################
Please visit: q7.php
Please visit: q7.txt
###### Question No. 8 ##################################################
####################################################
#
# Consider you have the following text:
# "%pname% is diagnosed with %disease%. %pname% will
# get blood packs in order to improve his %disease%."
#
# Use the appropriate string manipulation
# commands to change it to :
# "Peter is diagnosed with anemia. Peter will
# get blood packs in order to improve his anemia."
#
# Tip: Use the str_replace command
#
####################################################
Please visit: q8.php
Please visit: q8.txt
###### Question No. 9 ##################################################
####################################################
#
# Consider you have the following text:
# "Peter is diagnosed with anemia. Peter will
# get blood packs in order to improve his anemia."
#
# Use the appropriate string manipulation
# commands to make the Peter name bold and
# anemia italic.
#
# Tip: Use the str_replace command
#
####################################################
Please visit: q9.php
Please visit: q9.txt
###### Question No. 10 ##################################################
####################################################
#
# Consider you have the following array:
# "WhiteBloodCell:4.4", "RedBloodCell:5.6", "Hgb:16.5"
#
# Use the appropriate string manipulation
# commands to change the array to:
# "4.4", "5.6" and "16.5"
#
# Tip: Use the strstr command and then substr & strlen
#
####################################################
Please visit: q10.php
Please visit: q10.txt
###### Question No. 11 ##################################################
####################################################
#
# Consider you have the following array:
# ('Peter', 'Robin', 'Brian', 'Mark')
#
# Use the appropriate array manipulation
# command(s) to sort it
#
# Tip: Use the sort command
#
####################################################
Please visit: q11.php
Please visit: q11.txt
###### Question No. 12 ##################################################
####################################################
#
# Consider you have the following array:
# ('Peter', 'Robin', 'Brian', 'Mark')
#
# Use the appropriate array manipulation
# command(s) to reverse sort it
#
# Tip: Use the rsort command
#
####################################################
Please visit: q12.php
Please visit: q12.txt
###### Question No. 13 ##################################################
####################################################
#
# Consider you have the following array:
# ('Peter', 'Robin', 'Brian', 'Mark')
#
# Use the appropriate array manipulation
# command(s) to reverse it
#
# Tip: Use the array_reverse command
#
####################################################
Please visit: q13.php
Please visit: q13.txt
###### Question No. 14 ##################################################
####################################################
#
# Consider you have the following array:
# ('Peter', 'Robin', 'Brian', 'Mark')
#
# Use the appropriate array manipulation
# command(s) to delete the last element of it
#
# Tip: Use the array_pop command
#
####################################################
Please visit: q14.php
Please visit: q14.txt
###### Question No. 15 ##################################################
####################################################
#
# Consider you have the following array:
# ('Peter', 'Robin', 'Brian', 'Mark')
#
# Use the appropriate array manipulation
# command(s) to delete the first element of it
#
# Tip: Use the array_shift command
#
####################################################
Please visit: q15.php
Please visit: q15.txt
###### Question No. 16 ##################################################
####################################################
#
# Consider you have the following array:
# ('Robin', 'Brian')
#
# Use the appropriate array manipulation
# command(s) to add 'Peter' at the beginning
# and 'Mark' at the end of the array
#
# Tip: Use the array_unshift and array_push commands
#
####################################################
Please visit: q16.php
Please visit: q16.txt
###### Question No. 17 ##################################################
####################################################
#
# Consider you have the following array:
# ('Peter', 'Robin', 'Brian', 'Mark', 'Bob')
#
# Use the appropriate array manipulation
# command(s) to make another array which only
# contains element number 2,3 and 4
#
# Tip: Use the array_slice command
#
####################################################
Please visit: q17.php
Please visit: q17.txt
###### Question No. 18 ##################################################
####################################################
#
# Consider you have the following array:
# ('Peter', 'Robin', 'Brian', 'Mark', 'Bob')
#
# Use the appropriate array manipulation
# command(s) to replace element 'Brian' and
# 'Mark' with 'John'
#
# Tip: Use the array_splice command
#
####################################################
Please visit: q18.php
Please visit: q18.txt
###### Question No. 19 ##################################################
####################################################
#
# Consider you have the following arrays:
# ('Peter', 'Robin')
# ('Brian', 'Mark', 'Bob')
#
# Use the appropriate array manipulation
# command(s) to make an array including both of them
#
# Tip: Use the array_merge command
#
####################################################
Please visit: q19.php
Please visit: q19.txt