diff --git a/INFO-1208 (PHP)/Labs/lab 4/info1208-lab4-l_mclean215318.zip b/INFO-1208 (PHP)/Labs/lab 4/info1208-lab4-l_mclean215318.zip new file mode 100644 index 0000000..26fdd56 Binary files /dev/null and b/INFO-1208 (PHP)/Labs/lab 4/info1208-lab4-l_mclean215318.zip differ diff --git a/INFO-1208 (PHP)/Labs/lab 4/lab4_complete.php b/INFO-1208 (PHP)/Labs/lab 4/lab4_complete.php new file mode 100644 index 0000000..f5b68df --- /dev/null +++ b/INFO-1208 (PHP)/Labs/lab 4/lab4_complete.php @@ -0,0 +1,61 @@ +'; + +echo '2. '; +$numeric_string = '12345'; +// In next line, inside if, check if $numeric_string is numeric: +if (is_numeric($numeric_string)) { + echo 'It is a number'; +} else { + echo 'It not a number'; +} +echo '
'; + + +echo '3. '; +// Update the values of the below variables so the output is 1: +$num1 = 1; +$num2 = 0; + +echo $num1 <=> $num2; +echo '
'; + + +echo '4. '; +$total_amount = 12434.453978; +// Using number_format() function, in next line, format $total_amount to 2 decimal places and var_dump() it: +$total_amount = number_format($total_amount, 2); +var_dump($total_amount); + +echo '
'; + + +echo '5. '; +$index1 = 10; +$index2 = 10; +// For $index1 use increment operator before var(++$a) and var_dump() it: +var_dump(++$index1); +// For $index2 use increment operator after var($a++) and var_dump() it: +var_dump($index2++); + + +echo '
'; + + +echo '6. '; +$int_ten = 10; +$string_ten = '10'; + +// In next line, compare $int_ten and $string_ten using the equality operator: +if ($int_ten == $string_ten) { + var_dump('Equal'); +} else { + var_dump('Not Equal'); +} diff --git a/INFO-1208 (PHP)/Labs/lab 4/lab_4.png b/INFO-1208 (PHP)/Labs/lab 4/lab_4.png new file mode 100644 index 0000000..645e3e5 Binary files /dev/null and b/INFO-1208 (PHP)/Labs/lab 4/lab_4.png differ