diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml new file mode 100644 index 0000000..a7d195f --- /dev/null +++ b/.github/workflows/php.yml @@ -0,0 +1,39 @@ +name: PHP Composer + +on: + push: + branches: [ "master" ] + pull_request: + branches: [ "master" ] + +permissions: + contents: read + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + + - name: Validate composer.json and composer.lock + run: composer validate --strict + + - name: Cache Composer packages + id: composer-cache + uses: actions/cache@v3 + with: + path: vendor + key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }} + restore-keys: | + ${{ runner.os }}-php- + + - name: Install dependencies + run: composer install --prefer-dist --no-progress + + # Add a test script to composer.json, for instance: "test": "vendor/bin/phpunit" + # Docs: https://getcomposer.org/doc/articles/scripts.md + + # - name: Run test suite + # run: composer run-script test diff --git a/01.Whataresessionsandcookies.pdf b/01.Whataresessionsandcookies.pdf new file mode 100644 index 0000000..fe1edea Binary files /dev/null and b/01.Whataresessionsandcookies.pdf differ diff --git a/ALLABOUTME.pdf b/ALLABOUTME.pdf new file mode 100644 index 0000000..cb277fd Binary files /dev/null and b/ALLABOUTME.pdf differ diff --git a/UDEMY_BEGINNERS/01.Whataresessionsandcookies.pdf b/UDEMY_BEGINNERS/01.Whataresessionsandcookies.pdf new file mode 100644 index 0000000..fe1edea Binary files /dev/null and b/UDEMY_BEGINNERS/01.Whataresessionsandcookies.pdf differ diff --git a/UDEMY_BEGINNERS/Aroundtheworldin80days.pdf b/UDEMY_BEGINNERS/Aroundtheworldin80days.pdf new file mode 100644 index 0000000..65d19c9 Binary files /dev/null and b/UDEMY_BEGINNERS/Aroundtheworldin80days.pdf differ diff --git a/UDEMY_BEGINNERS/Capitalcitiesoftheworld.pdf b/UDEMY_BEGINNERS/Capitalcitiesoftheworld.pdf new file mode 100644 index 0000000..693fa70 Binary files /dev/null and b/UDEMY_BEGINNERS/Capitalcitiesoftheworld.pdf differ diff --git a/UDEMY_BEGINNERS/CarpeDiem.pdf b/UDEMY_BEGINNERS/CarpeDiem.pdf new file mode 100644 index 0000000..41f68e7 Binary files /dev/null and b/UDEMY_BEGINNERS/CarpeDiem.pdf differ diff --git a/UDEMY_BEGINNERS/Challenge+1.pdf b/UDEMY_BEGINNERS/Challenge+1.pdf new file mode 100644 index 0000000..315e646 Binary files /dev/null and b/UDEMY_BEGINNERS/Challenge+1.pdf differ diff --git a/UDEMY_BEGINNERS/Darts/darts.css b/UDEMY_BEGINNERS/Darts/darts.css new file mode 100644 index 0000000..5158743 --- /dev/null +++ b/UDEMY_BEGINNERS/Darts/darts.css @@ -0,0 +1,17 @@ +.tableCell { + background-color: #9dd1a2; + text-align: right; +} + +.headerCell { + background-color: #9dbfd1; + text-align: center; +} + +td, th, .table { + border: 1px solid black !important; +} + +th,td { + text-align: center; +} \ No newline at end of file diff --git a/UDEMY_BEGINNERS/Darts/darts.php b/UDEMY_BEGINNERS/Darts/darts.php new file mode 100644 index 0000000..4aa990a --- /dev/null +++ b/UDEMY_BEGINNERS/Darts/darts.php @@ -0,0 +1,145 @@ + + + + + + + Darts + + + + + + + + + +
+
+
+ + + + + $th"; + } + ?> + + + + + + $score[$i]"; + } + ?> + + +
SCORE
No. OF POSSIBLE WAYS
+
+
+
+ + + + + + + + + + + + + "; + echo ""; + echo ""; + } + } +} + + ?> + + +
DART 1DART 2DART 3TOTAL
$dart1$dart2$dart3$total
+ + + +
+
+
+
+
+
+ + \ No newline at end of file diff --git a/UDEMY_BEGINNERS/Discount+Codes.pdf b/UDEMY_BEGINNERS/Discount+Codes.pdf new file mode 100644 index 0000000..ed2cc68 Binary files /dev/null and b/UDEMY_BEGINNERS/Discount+Codes.pdf differ diff --git a/UDEMY_BEGINNERS/ExtensionChallenges.pdf b/UDEMY_BEGINNERS/ExtensionChallenges.pdf new file mode 100644 index 0000000..82c8779 Binary files /dev/null and b/UDEMY_BEGINNERS/ExtensionChallenges.pdf differ diff --git a/UDEMY_BEGINNERS/FizzBuzzChallenge.pdf b/UDEMY_BEGINNERS/FizzBuzzChallenge.pdf new file mode 100644 index 0000000..a346fa5 Binary files /dev/null and b/UDEMY_BEGINNERS/FizzBuzzChallenge.pdf differ diff --git a/UDEMY_BEGINNERS/HITMEBABYONEMORETIME.pdf b/UDEMY_BEGINNERS/HITMEBABYONEMORETIME.pdf new file mode 100644 index 0000000..6110d6c Binary files /dev/null and b/UDEMY_BEGINNERS/HITMEBABYONEMORETIME.pdf differ diff --git a/UDEMY_BEGINNERS/How+long+is+a+piece+of+string.php/string-length-form.php b/UDEMY_BEGINNERS/How+long+is+a+piece+of+string.php/string-length-form.php new file mode 100644 index 0000000..34e950b --- /dev/null +++ b/UDEMY_BEGINNERS/How+long+is+a+piece+of+string.php/string-length-form.php @@ -0,0 +1,20 @@ + + + + + + + + String Length + + + +
+ + Y + N + +
+ + + \ No newline at end of file diff --git a/UDEMY_BEGINNERS/How+long+is+a+piece+of+string.php/string-length-processor.php b/UDEMY_BEGINNERS/How+long+is+a+piece+of+string.php/string-length-processor.php new file mode 100644 index 0000000..87f3ee6 --- /dev/null +++ b/UDEMY_BEGINNERS/How+long+is+a+piece+of+string.php/string-length-processor.php @@ -0,0 +1,13 @@ + + + + + + + ISBN Checker + + +
+ + +
+ + \ No newline at end of file diff --git a/UDEMY_BEGINNERS/ISBN/isbn-processor.php b/UDEMY_BEGINNERS/ISBN/isbn-processor.php new file mode 100644 index 0000000..0c60ccc --- /dev/null +++ b/UDEMY_BEGINNERS/ISBN/isbn-processor.php @@ -0,0 +1,30 @@ + + + + + + + Credit Card Checker + + +
+ + +
+ + \ No newline at end of file diff --git a/UDEMY_BEGINNERS/Lets+Go+Shopping/shopping-processor.php b/UDEMY_BEGINNERS/Lets+Go+Shopping/shopping-processor.php new file mode 100644 index 0000000..82a9253 --- /dev/null +++ b/UDEMY_BEGINNERS/Lets+Go+Shopping/shopping-processor.php @@ -0,0 +1,53 @@ + 9 + if($digit > 9){ + //subtract 9 + $digit -= 9; + } + } + //total = total + digit + $total += $digit; + //incrementor + 1 + $i++; + } + + + //check total / 10 + if($total % 10 == 0){ + echo "Your credit card number with last 4 digits " . $last4 . " is valid"; + } else { + echo "Your credit card number with last 4 digits " . $last4 . " is invalid"; + } + + +} + + +//outside of message check + + + + diff --git a/UDEMY_BEGINNERS/Mindyourlanguage.pdf b/UDEMY_BEGINNERS/Mindyourlanguage.pdf new file mode 100644 index 0000000..006ed79 Binary files /dev/null and b/UDEMY_BEGINNERS/Mindyourlanguage.pdf differ diff --git a/UDEMY_BEGINNERS/MissionImpossible.pdf b/UDEMY_BEGINNERS/MissionImpossible.pdf new file mode 100644 index 0000000..c8d6f74 Binary files /dev/null and b/UDEMY_BEGINNERS/MissionImpossible.pdf differ diff --git a/UDEMY_BEGINNERS/MultiplesChallenge.pdf b/UDEMY_BEGINNERS/MultiplesChallenge.pdf new file mode 100644 index 0000000..0a7421a Binary files /dev/null and b/UDEMY_BEGINNERS/MultiplesChallenge.pdf differ diff --git a/UDEMY_BEGINNERS/Odds+or+Evens.pdf b/UDEMY_BEGINNERS/Odds+or+Evens.pdf new file mode 100644 index 0000000..5653acb Binary files /dev/null and b/UDEMY_BEGINNERS/Odds+or+Evens.pdf differ diff --git a/UDEMY_BEGINNERS/Palindrome+Php b/UDEMY_BEGINNERS/Palindrome+Php new file mode 100644 index 0000000..cae8350 Binary files /dev/null and b/UDEMY_BEGINNERS/Palindrome+Php differ diff --git a/UDEMY_BEGINNERS/Pickacard.pdf b/UDEMY_BEGINNERS/Pickacard.pdf new file mode 100644 index 0000000..ae56d5f Binary files /dev/null and b/UDEMY_BEGINNERS/Pickacard.pdf differ diff --git a/UDEMY_BEGINNERS/SantaClausiscomingtotown.pdf b/UDEMY_BEGINNERS/SantaClausiscomingtotown.pdf new file mode 100644 index 0000000..066a48c Binary files /dev/null and b/UDEMY_BEGINNERS/SantaClausiscomingtotown.pdf differ diff --git a/UDEMY_BEGINNERS/Setting+up+the+development+environment.pdf b/UDEMY_BEGINNERS/Setting+up+the+development+environment.pdf new file mode 100644 index 0000000..d95ae5b Binary files /dev/null and b/UDEMY_BEGINNERS/Setting+up+the+development+environment.pdf differ diff --git a/UDEMY_BEGINNERS/TheGreatEscape.pdf b/UDEMY_BEGINNERS/TheGreatEscape.pdf new file mode 100644 index 0000000..198d960 Binary files /dev/null and b/UDEMY_BEGINNERS/TheGreatEscape.pdf differ diff --git a/UDEMY_BEGINNERS/Whoateallthepi.pdf b/UDEMY_BEGINNERS/Whoateallthepi.pdf new file mode 100644 index 0000000..75aeb85 Binary files /dev/null and b/UDEMY_BEGINNERS/Whoateallthepi.pdf differ diff --git a/UDEMY_BEGINNERS/around-the-world.php/around-the-world.php b/UDEMY_BEGINNERS/around-the-world.php/around-the-world.php new file mode 100644 index 0000000..f6f4be5 --- /dev/null +++ b/UDEMY_BEGINNERS/around-the-world.php/around-the-world.php @@ -0,0 +1,27 @@ +"; + +foreach($cities as $city){ + echo "
  • $city
  • "; +} + +echo ""; + +array_push($cities, "Sydney", "Helsinki", "Beijing", "Dublin", "Rome"); + +sort($cities); + +echo "
      "; + +foreach ($cities as $city) { + echo "
    1. $city
    2. "; +} + +echo "
    "; \ No newline at end of file diff --git a/UDEMY_BEGINNERS/array-pop.php/array-pop.php b/UDEMY_BEGINNERS/array-pop.php/array-pop.php new file mode 100644 index 0000000..e8700a3 --- /dev/null +++ b/UDEMY_BEGINNERS/array-pop.php/array-pop.php @@ -0,0 +1,21 @@ +"; + +echo "
    ";
    +
    +print_r($cities);
    +
    +$firstCity = array_shift($cities);
    +
    +echo $firstCity;
    +
    +echo "
    "; + +print_r($cities); \ No newline at end of file diff --git a/UDEMY_BEGINNERS/array-push.php/array-push.php b/UDEMY_BEGINNERS/array-push.php/array-push.php new file mode 100644 index 0000000..6f88b31 --- /dev/null +++ b/UDEMY_BEGINNERS/array-push.php/array-push.php @@ -0,0 +1,15 @@ +"; + +print_r($cities); + +array_push($cities, "Brisbane", "Sydney"); + +print_r($cities); + +array_unshift($cities, "Dublin", "Amsterdam"); + +print_r($cities); \ No newline at end of file diff --git a/UDEMY_BEGINNERS/array-slice.php/array-slice.php b/UDEMY_BEGINNERS/array-slice.php/array-slice.php new file mode 100644 index 0000000..ca79f6c --- /dev/null +++ b/UDEMY_BEGINNERS/array-slice.php/array-slice.php @@ -0,0 +1,14 @@ +"; +print_r($result); + +$result = array_slice($letters, 0, 5); +print_r($result); + +$result = array_slice($letters, -5, 2); +print_r($result); \ No newline at end of file diff --git a/UDEMY_BEGINNERS/arrays.php/arrays.php b/UDEMY_BEGINNERS/arrays.php/arrays.php new file mode 100644 index 0000000..bf8ac50 --- /dev/null +++ b/UDEMY_BEGINNERS/arrays.php/arrays.php @@ -0,0 +1,12 @@ +"; +print_r($names); + +$cities = ["Paris", "London", "Tokyo"]; +print_r($cities); + +$mixed = [5, "Sam", 'John', 9.54, TRUE]; +print_r($mixed); \ No newline at end of file diff --git a/UDEMY_BEGINNERS/associative-array.php/associative-array.php b/UDEMY_BEGINNERS/associative-array.php/associative-array.php new file mode 100644 index 0000000..5f996bd --- /dev/null +++ b/UDEMY_BEGINNERS/associative-array.php/associative-array.php @@ -0,0 +1,14 @@ +"; +} + + +$students = ["Sam"=>12, "Holly"=>11, "Ben"=>9]; + +foreach($students as $student=>$age){ + echo "$student is $age years old.
    "; +} \ No newline at end of file diff --git a/UDEMY_BEGINNERS/back-to-school.php/back-to-school.php b/UDEMY_BEGINNERS/back-to-school.php/back-to-school.php new file mode 100644 index 0000000..4cb5c13 --- /dev/null +++ b/UDEMY_BEGINNERS/back-to-school.php/back-to-school.php @@ -0,0 +1,65 @@ +" . $areaTriangle; + +// Area of a circle + +$radius = 5; + +$pi = 3.14; + +$areaCircle = $pi * pow($radius, 2); + +echo "
    " . $areaCircle; + +$areaCircle = pi() * pow($radius, 2); + +echo "
    " . $areaCircle; + +// Area of a trapezium + +$a = 10; + +$b = 8; + +$height = 4; + +$area = ($a + $b) * $height / 2; + +echo "
    " . $area; + + + + + + + + + + + + + + + + + + diff --git a/UDEMY_BEGINNERS/capital-cities.php/capital-cities.php b/UDEMY_BEGINNERS/capital-cities.php/capital-cities.php new file mode 100644 index 0000000..0f68ba7 --- /dev/null +++ b/UDEMY_BEGINNERS/capital-cities.php/capital-cities.php @@ -0,0 +1,11 @@ + "Rome", "Luxembourg" => "Luxembourg", "Belgium" => "Brussels", "Denmark" => "Copenhagen", "Finland" => "Helsinki", "France" => "Paris", "Slovakia" => "Bratislava", "Slovenia" => "Ljubljana", "Germany" => "Berlin", "Greece" => "Athens", "Ireland" => "Dublin", "Netherlands" => "Amsterdam", "Portugal" => "Lisbon", "Spain" => "Madrid", "Sweden" => "Stockholm", "United Kingdom" => "London", "Cyprus" => "Nicosia", "Lithuania" => "Vilnius", "Czech Republic" => "Prague", "Estonia" => "Tallin", "Hungary" => "Budapest", "Latvia" => "Riga", "Malta" => "Valetta", "Austria" => "Vienna", "Poland" => "Warsaw" +]; + +asort($capitals); + +foreach($capitals as $country=>$capital){ + echo "The capital city of $country is $capital.
    "; +} \ No newline at end of file diff --git a/UDEMY_BEGINNERS/carpe-diem.php/carpe-diem.php b/UDEMY_BEGINNERS/carpe-diem.php/carpe-diem.php new file mode 100644 index 0000000..b18df99 --- /dev/null +++ b/UDEMY_BEGINNERS/carpe-diem.php/carpe-diem.php @@ -0,0 +1,31 @@ +"; + + // 2. Today is Friday + echo "Today is " . date('l'); + echo "
    "; + + // 3. Friday 16 July, 2021 + echo date('l d F, Y'); + echo "
    "; + + // 4. 2021/07/16 (Year / Month / Day) + echo date('Y/m/d'); + echo "
    "; + + // 5. Friday 16th July 2021, 3:12 PM + echo date('l dS F Y, g:i A'); + echo "
    "; + + $year = date('L'); + + if($year){ + echo "This is a leap year"; + } else { + echo "This is not a leap year"; + } \ No newline at end of file diff --git a/UDEMY_BEGINNERS/chessboard.php b/UDEMY_BEGINNERS/chessboard.php new file mode 100644 index 0000000..7b002b2 --- /dev/null +++ b/UDEMY_BEGINNERS/chessboard.php @@ -0,0 +1,41 @@ + + + + Chessboard + + + +
    + + +
    + + "; + + for($row=1; $row<=$gridsize; $row++){ + echo ""; + + for($col=1; $col<=$gridsize; $col++){ + if(($row+$col) % 2 == 0){ + echo ""; + } else { + echo ""; + } + } + + echo ""; + } + + echo ""; + + } + + ?> + + + \ No newline at end of file diff --git a/UDEMY_BEGINNERS/create-a-session.php/create-a-session.php b/UDEMY_BEGINNERS/create-a-session.php/create-a-session.php new file mode 100644 index 0000000..3d3ace0 --- /dev/null +++ b/UDEMY_BEGINNERS/create-a-session.php/create-a-session.php @@ -0,0 +1,6 @@ +"; + +echo "Today is " . date('l'); + +echo "
    "; + +echo "The time is " . date('g:i a'); \ No newline at end of file diff --git a/UDEMY_BEGINNERS/days-until-christmas.php/days-until-christmas.php b/UDEMY_BEGINNERS/days-until-christmas.php/days-until-christmas.php new file mode 100644 index 0000000..1edca11 --- /dev/null +++ b/UDEMY_BEGINNERS/days-until-christmas.php/days-until-christmas.php @@ -0,0 +1,17 @@ +"; + +$i = $i - 1; + +echo $i . "
    "; + +$i -= 1; + +echo $i . "
    "; + +$i--; + +echo $i . "
    "; diff --git a/UDEMY_BEGINNERS/delete-a-session.php/delete-a-session.php b/UDEMY_BEGINNERS/delete-a-session.php/delete-a-session.php new file mode 100644 index 0000000..f795b19 --- /dev/null +++ b/UDEMY_BEGINNERS/delete-a-session.php/delete-a-session.php @@ -0,0 +1,8 @@ +"; + +echo "Hello, $name you are $age years old."; + +echo "
    "; + +echo 'Hello, ' . $name . ' you are ' . $age . ' years old.'; + +echo '
    '; + +echo 'Hello, $name you are $age years old.'; \ No newline at end of file diff --git a/UDEMY_BEGINNERS/escaping-strings.php/escaping-strings.php b/UDEMY_BEGINNERS/escaping-strings.php/escaping-strings.php new file mode 100644 index 0000000..13b332a --- /dev/null +++ b/UDEMY_BEGINNERS/escaping-strings.php/escaping-strings.php @@ -0,0 +1,13 @@ +"; + +echo 'Tom\'s got a great book called "Hello, World!"'; \ No newline at end of file diff --git a/UDEMY_BEGINNERS/explode-implode.php/explode-implode.php b/UDEMY_BEGINNERS/explode-implode.php/explode-implode.php new file mode 100644 index 0000000..af52a93 --- /dev/null +++ b/UDEMY_BEGINNERS/explode-implode.php/explode-implode.php @@ -0,0 +1,13 @@ +"; + +print_r($explodedNames); + +$implodedNames = implode("|", $explodedNames); + +echo $implodedNames; \ No newline at end of file diff --git a/UDEMY_BEGINNERS/fizz-buzz.php/fizz-buzz.php b/UDEMY_BEGINNERS/fizz-buzz.php/fizz-buzz.php new file mode 100644 index 0000000..5b6a5fd --- /dev/null +++ b/UDEMY_BEGINNERS/fizz-buzz.php/fizz-buzz.php @@ -0,0 +1,14 @@ +"; +} \ No newline at end of file diff --git a/UDEMY_BEGINNERS/for-loop.php/for-loop.php b/UDEMY_BEGINNERS/for-loop.php/for-loop.php new file mode 100644 index 0000000..cdc0e59 --- /dev/null +++ b/UDEMY_BEGINNERS/for-loop.php/for-loop.php @@ -0,0 +1,9 @@ +"; +} + +for($i = 2; $i <= 20; $i += 2){ + echo $i . "
    "; +} \ No newline at end of file diff --git a/UDEMY_BEGINNERS/functions.php/functions.php b/UDEMY_BEGINNERS/functions.php/functions.php new file mode 100644 index 0000000..a2e775c --- /dev/null +++ b/UDEMY_BEGINNERS/functions.php/functions.php @@ -0,0 +1,7 @@ +"; + +echo "The 5 lowest temperatures are " . $lowestTemperatures; + +echo "
    "; + +echo "The 5 highest temperatures are " . $highestTemperatures; + + + + + diff --git a/UDEMY_BEGINNERS/html-form-processor.php/html-form-processor.php b/UDEMY_BEGINNERS/html-form-processor.php/html-form-processor.php new file mode 100644 index 0000000..8a2276e --- /dev/null +++ b/UDEMY_BEGINNERS/html-form-processor.php/html-form-processor.php @@ -0,0 +1,14 @@ +"; +// print_r ($_POST); + +if(isset($_POST['submit'])){ + $surname = $_POST['surname']; + + $gender = $_POST['gender']; + + echo "Your surname is " . $surname . " and your gender is " . $gender; +} else { + echo "Please visit the form page"; +} diff --git a/UDEMY_BEGINNERS/html-form.php/html-form.php b/UDEMY_BEGINNERS/html-form.php/html-form.php new file mode 100644 index 0000000..fb7e7bc --- /dev/null +++ b/UDEMY_BEGINNERS/html-form.php/html-form.php @@ -0,0 +1,20 @@ + + + + + + + + HTML Form + + + +
    + + Male + Female + +
    + + + \ No newline at end of file diff --git a/UDEMY_BEGINNERS/html-layout.php/html-layout.php b/UDEMY_BEGINNERS/html-layout.php/html-layout.php new file mode 100644 index 0000000..56efbdb --- /dev/null +++ b/UDEMY_BEGINNERS/html-layout.php/html-layout.php @@ -0,0 +1,12 @@ + + + + + + + Document + + + + + \ No newline at end of file diff --git a/UDEMY_BEGINNERS/if-elseif.php/if-elseif.php b/UDEMY_BEGINNERS/if-elseif.php/if-elseif.php new file mode 100644 index 0000000..860879f --- /dev/null +++ b/UDEMY_BEGINNERS/if-elseif.php/if-elseif.php @@ -0,0 +1,17 @@ + $b){ + echo "greater than"; +} else if($a < $b){ + echo "less than"; +} else { + echo "equals"; +} \ No newline at end of file diff --git a/UDEMY_BEGINNERS/if.php/if.php b/UDEMY_BEGINNERS/if.php/if.php new file mode 100644 index 0000000..9d09699 --- /dev/null +++ b/UDEMY_BEGINNERS/if.php/if.php @@ -0,0 +1,13 @@ +"; + +$i = $i + 1; + +echo $i . "
    "; + +$i += 1; + +echo $i . "
    "; + +$i++; + +echo $i . "
    "; \ No newline at end of file diff --git a/UDEMY_BEGINNERS/logical.php/logical.php b/UDEMY_BEGINNERS/logical.php/logical.php new file mode 100644 index 0000000..7ffde35 --- /dev/null +++ b/UDEMY_BEGINNERS/logical.php/logical.php @@ -0,0 +1,15 @@ + 10)){ + echo "True"; +} else { + echo "False"; +} diff --git a/UDEMY_BEGINNERS/loop-arrays.php/loop-arrays.php b/UDEMY_BEGINNERS/loop-arrays.php/loop-arrays.php new file mode 100644 index 0000000..86b91ca --- /dev/null +++ b/UDEMY_BEGINNERS/loop-arrays.php/loop-arrays.php @@ -0,0 +1,11 @@ +"; + +foreach($names as $name){ + echo "
  • $name
  • "; +} + +echo ""; \ No newline at end of file diff --git a/UDEMY_BEGINNERS/mind-your-language.php/mind-your-language.php b/UDEMY_BEGINNERS/mind-your-language.php/mind-your-language.php new file mode 100644 index 0000000..4144d4b --- /dev/null +++ b/UDEMY_BEGINNERS/mind-your-language.php/mind-your-language.php @@ -0,0 +1,11 @@ +"; +} + +$j = 6; + +while($j <= 60){ + echo $j . "
    "; + $j += 6; +} \ No newline at end of file diff --git a/UDEMY_BEGINNERS/odds-evens.php/odds-evens.php b/UDEMY_BEGINNERS/odds-evens.php/odds-evens.php new file mode 100644 index 0000000..cb3f276 --- /dev/null +++ b/UDEMY_BEGINNERS/odds-evens.php/odds-evens.php @@ -0,0 +1,15 @@ + + + + + Palindromes + + +
    + + +
    + + \ No newline at end of file diff --git a/UDEMY_BEGINNERS/passing-values-to-functions.php/passing-values-to-functions.php b/UDEMY_BEGINNERS/passing-values-to-functions.php/passing-values-to-functions.php new file mode 100644 index 0000000..2d54b30 --- /dev/null +++ b/UDEMY_BEGINNERS/passing-values-to-functions.php/passing-values-to-functions.php @@ -0,0 +1,11 @@ +"; + +multiply(3, 9); \ No newline at end of file diff --git a/UDEMY_BEGINNERS/pick-a-card.php/pick-a-card.php b/UDEMY_BEGINNERS/pick-a-card.php/pick-a-card.php new file mode 100644 index 0000000..02d2495 --- /dev/null +++ b/UDEMY_BEGINNERS/pick-a-card.php/pick-a-card.php @@ -0,0 +1,13 @@ +"; +echo "2 = " . $twos; \ No newline at end of file diff --git a/UDEMY_BEGINNERS/random-array.php/random-array.php b/UDEMY_BEGINNERS/random-array.php/random-array.php new file mode 100644 index 0000000..c15f71f --- /dev/null +++ b/UDEMY_BEGINNERS/random-array.php/random-array.php @@ -0,0 +1,15 @@ +"; + +$cityPosition = array_rand($cities); + +$city = $cities[$cityPosition]; + +echo $city; \ No newline at end of file diff --git a/UDEMY_BEGINNERS/read-a-session.php/read-a-session.php b/UDEMY_BEGINNERS/read-a-session.php/read-a-session.php new file mode 100644 index 0000000..5179024 --- /dev/null +++ b/UDEMY_BEGINNERS/read-a-session.php/read-a-session.php @@ -0,0 +1,17 @@ +"; + +if (isset($_SESSION['age'])) { + echo $_SESSION['age']; +} else { + echo "Session has not been set"; +} diff --git a/UDEMY_BEGINNERS/returning-multiple-results-from-functions.php/returning-multiple-results-from-functions.php b/UDEMY_BEGINNERS/returning-multiple-results-from-functions.php/returning-multiple-results-from-functions.php new file mode 100644 index 0000000..8a773dc --- /dev/null +++ b/UDEMY_BEGINNERS/returning-multiple-results-from-functions.php/returning-multiple-results-from-functions.php @@ -0,0 +1,14 @@ +"; +echo $results[1]; +echo "
    "; diff --git a/UDEMY_BEGINNERS/returning-values-from-functions.php/returning-values-from-functions.php b/UDEMY_BEGINNERS/returning-values-from-functions.php/returning-values-from-functions.php new file mode 100644 index 0000000..9ca0b0f --- /dev/null +++ b/UDEMY_BEGINNERS/returning-values-from-functions.php/returning-values-from-functions.php @@ -0,0 +1,10 @@ + + + + + + + + Temperature Conversion + + + +
    + + C + F + + + + + + + + + + +
    + + + \ No newline at end of file diff --git a/UDEMY_BEGINNERS/temperature-processor.php/temperature-processor.php b/UDEMY_BEGINNERS/temperature-processor.php/temperature-processor.php new file mode 100644 index 0000000..ebe93c8 --- /dev/null +++ b/UDEMY_BEGINNERS/temperature-processor.php/temperature-processor.php @@ -0,0 +1,19 @@ +"; + +echo "$name said, \"Hello, Colin. How's your new PHP course going?\"."; +echo "
    "; + +echo "$name's mother ordered a new book called \"A Day in my Life\" from her local bookstore."; +echo "
    "; + +echo 'This is ' . $name . '\'s apple!'; +echo '
    '; + +echo $name . 'said, "Hello, Colin. How\'s your new PHP course going?".'; +echo '
    '; + +echo $name . '\'s mother ordered a new book called "A Day in my Life" from her local bookstore.'; +echo '
    '; \ No newline at end of file diff --git a/UDEMY_BEGINNERS/update-a-session.php/update-a-session.php b/UDEMY_BEGINNERS/update-a-session.php/update-a-session.php new file mode 100644 index 0000000..178d946 --- /dev/null +++ b/UDEMY_BEGINNERS/update-a-session.php/update-a-session.php @@ -0,0 +1,6 @@ +"; + $i++; +} + +$j = 2; + +while($j <= 20){ + echo $j . "
    "; + $j += 2; +} \ No newline at end of file diff --git a/UDEMY_BEGINNERS/who-ate-all-the-pi.php/who-ate-all-the-pi.php b/UDEMY_BEGINNERS/who-ate-all-the-pi.php/who-ate-all-the-pi.php new file mode 100644 index 0000000..ce372c2 --- /dev/null +++ b/UDEMY_BEGINNERS/who-ate-all-the-pi.php/who-ate-all-the-pi.php @@ -0,0 +1,15 @@ +"; + +$area = round($area, 2, PHP_ROUND_HALF_UP); +echo $area; + +echo "
    "; + +echo "The area of a circle with radius of $radius is $area to 2 d.p."; \ No newline at end of file diff --git a/UDEMY_BEGINNERS/word-count.php/word-count.php b/UDEMY_BEGINNERS/word-count.php/word-count.php new file mode 100644 index 0000000..fc1f48b --- /dev/null +++ b/UDEMY_BEGINNERS/word-count.php/word-count.php @@ -0,0 +1,7 @@ + + + + + + + All About Me + + +
    + + + + +
    + + \ No newline at end of file diff --git a/all-about-me/all-about-me/process.php b/all-about-me/all-about-me/process.php new file mode 100644 index 0000000..447a976 --- /dev/null +++ b/all-about-me/all-about-me/process.php @@ -0,0 +1,13 @@ +"; + +echo "Your age is $age
    "; + +echo "Your favourite colour is $colour"; \ No newline at end of file diff --git a/delete-a-cookie.php/delete-a-cookie.php b/delete-a-cookie.php/delete-a-cookie.php new file mode 100644 index 0000000..cd220c8 --- /dev/null +++ b/delete-a-cookie.php/delete-a-cookie.php @@ -0,0 +1,3 @@ +"; + +echo $secondSentence; \ No newline at end of file diff --git a/read-a-cookie.php/read-a-cookie.php b/read-a-cookie.php/read-a-cookie.php new file mode 100644 index 0000000..fd7d20e --- /dev/null +++ b/read-a-cookie.php/read-a-cookie.php @@ -0,0 +1,7 @@ +