From 19d957ab8a2941b34d80cd23f0d05c1575d6ffc2 Mon Sep 17 00:00:00 2001
From: davidmoina First array: ", var_dump($arr1)," Second array: ", var_dump($arr2)," Multidimensional array: ", var_dump($arrMult)," Length of second array is ", count($arr2)," The combination of the first and second array is", var_dump($arrComb), " The last element of the first array is: ", end($arr1)," Now I added banana to the first array and it is the result: ", var_dump($arr1)," the current minute is less than 10 the current minute is more than 15 does not meet any conditions Today is $day Today is $day Today is $day Today is $day Today is $day Today is $day Today is $day The result of 2 + 5 = ", sum(2, 5)," The result of 2 x 5 = ", mul(2, 5)," The result of 10 / 2 = ", div(10, 2)," The absolute value of -5 is $absValue The rounded value to the next highest integer of 2.5 is $roundedValue The maximum value of (3, 4, 9, 1, 7) is $maxValue The minimum value of (3, 4, 9, 1, 7) is $minValue Hello Assembler My name is $name. University is great to study in it. I like play Football Length of $name: ", strlen($name), " Position of v in $name: ", strpos($name, "v")," My name converted to uppercase: ", strtoupper($name)," My name converted to lowercase: ", strtolower($name)," A substring text of $name from a given position(2): ", substr($name, 2),"
";
+ } else {
+ echo $month, "
";
+ }
+
+ #double condition
+ $minute = date("i");
+
+ if($minute < 10) {
+ echo "
";
+
+ #current date in any format
+ echo "Current date: ", $dateVar->format('Y-m-d H:i:sP'), "
";
+
+ #current day
+ echo "Current day: ", date("l"), "
";
+
+ #current month in numerical format
+ echo "Month: ", date("m"), "
";
+
+ #current minute with leading zeros
+ echo "Current minute: ",date('i');
+
+?>
\ No newline at end of file
diff --git a/functions.php b/functions.php
new file mode 100644
index 0000000..4e66499
--- /dev/null
+++ b/functions.php
@@ -0,0 +1,39 @@
+Functions";
+
+ #function to sum two numbers
+ function sum($num1, $num2) {
+ return $num1 + $num2;
+ };
+
+ echo "
";
+
+ $arr = array("David", "Moina", 0 , 1);
+
+ foreach($arr as $value) {
+ echo "$value
";
+ }
+
+ print "
";
+
+ $number = 0;
+
+ while ($number <= 10) {
+ echo "$number ";
+ $number++;
+ }
+
+ print "
";
+
+ $ej = 10;
+
+ do {
+ echo "$ej ";
+ $ej--;
+ } while($ej > 0);
+
+?>
\ No newline at end of file
diff --git a/maths.php b/maths.php
new file mode 100644
index 0000000..31e554a
--- /dev/null
+++ b/maths.php
@@ -0,0 +1,21 @@
+mathematical operators";
+
+ #absolute value
+ $absValue = abs(-5);
+ echo "arithmetic operators
";
+
+ echo "5 + 5 = ",var_dump(5 + 5), "
";
+
+ echo "9 - 3 = ",var_dump(9 - 3), "
";
+
+ echo "3 * 10 = ",var_dump(3 * 10), "
";
+
+ echo "30 / 3 = ",var_dump(30 / 3), "
";
+
+ echo "20 % 2 = ",var_dump(20 % 2), "
";
+
+ #comparison operators
+ print "comparison operators
";
+
+ echo "(1 == 2) = ",var_dump(5 + 5), "
";
+
+ echo "(4 != 5) = ",var_dump(4 != 5), "
";
+
+ echo "(3 < 5) = ",var_dump(3 < 5), "
";
+
+ echo "(3 > 5) = ",var_dump(3 > 5), "
";
+
+ echo "(5 <= 5) = ",var_dump(5 <= 5), "
";
+
+ echo "(5 >= 6) = ",var_dump(5 >= 6), "
";
+
+ #logical operators
+ print "logical operators
";
+
+ $a = false;
+ $b = true;
+
+ echo "a = false, b = true
";
+
+ echo "(a && b) = ", var_dump($a && $b), "
";
+
+ echo "(a and b) = ", var_dump($a and $b), "
";
+
+ echo "(a || b) = ", var_dump($a || $b), "
";
+
+ echo "(a or b) = ", var_dump($a or $b), "
";
+
+ echo "(!a) = ", var_dump(!$a), "
";
+?>
\ No newline at end of file
diff --git a/phpinfo.php b/phpinfo.php
new file mode 100644
index 0000000..3c20906
--- /dev/null
+++ b/phpinfo.php
@@ -0,0 +1,5 @@
+PHP Info";
+
+ phpinfo();
+?>
\ No newline at end of file
diff --git a/print.php b/print.php
new file mode 100644
index 0000000..604e37d
--- /dev/null
+++ b/print.php
@@ -0,0 +1,11 @@
+Print";
+
+ echo "Its my first time with PHP
";
+
+ print "Hello my name is David
";
+
+ $a = array ('a' => 'manzana', 'b' => 'banana', 'c' => array ('x', 'y', 'z'));
+
+ print_r($a);
+?>
\ No newline at end of file
diff --git a/strings.php b/strings.php
new file mode 100644
index 0000000..630b49e
--- /dev/null
+++ b/strings.php
@@ -0,0 +1,40 @@
+Strings";
+
+ echo "
this is a integer: $integer
"; + + $float = 2.5; + echo "this is a float: $float
"; + + $string = "Hello"; + echo "this is a string: $string
"; + + $arr = array(1, 2, 3 , 4); + echo "this is an array: ", var_dump($arr), "
"; + + $obj = (object)["el_1" => "item1", "el_2" => "item2"]; + echo "this is an object: ", var_dump($obj), "
"; + + $nll = NULL; + echo "this is a NULL type: $nll
" +?> \ No newline at end of file From 1c9a463fdcd9d2f0701967098a946b8cd6919506 Mon Sep 17 00:00:00 2001 From: davidmoina- -
+ -> In this project you will learn the basic notions of the famous PHP language which is so used in the world of web development. -> -> What distinguishes PHP from other languages such as Javascript is that the code is executed on the server, generating HTML and sending it to the client. +# PHP Basics -## Index +> In this project I will learned the basic notions of PHP, language which is so used in the world of web development. -- [Requirements](#requirements) -- [Repository](#repository) -- [Technologies used](#technologies-used) -- [Project delivery](#project-delivery) -- [Resources](#resources) +All the exercises have been done using PHP as language and using Xampp as web server. + +## What I've learned -## Requirements + -- Learn the basics to program in PHP -- Understand what a server-side language is and what it is used for +- Learn the basics to program in PHP. -## Repository +- What is a server-side language and what it is used for. -First of all you must fork this project into your GitHub account. +- What is **XAMPP** and how to use it. -To create a fork on GitHub is as easy as clicking the “fork” button on the repository page. +- Improve GitHub knowledge. - + ## Technologies used -\* PHP + -## Project delivery - -To deliver this project you must send a Pull Request as explained in the Students Handbook. Remember that the PR title must be with the format -- Solution: + NAME AND SURNAME or TEAM NAMES AND SURNAMES. -- For example: "Solution: Josep Riera", "Solution: Josep Riera, Toni Suárez, Marta Vázquez" - -## Resources +\* PHP -- [What can PHP do?](https://www.php.net/manual/es/intro-whatcando.php) -- [Sample guide for README](https://gist.github.com/Villanuevand/6386899f70346d4580c723232524d35a) -- [XAMPP](https://www.apachefriends.org/es/index.html) -- [How to install XAMPP on Windows](https://www.youtube.com/watch?v=h6DEDm7C37A) -- [What is a web server?](https://www.youtube.com/watch?v=Yt1nesKi5Ec) -- [Web server basics](https://www.youtube.com/watch?v=3VqfpVKvlxQ) +## Autor +* **[David Moina](https://github.com/davidmoina)** \ No newline at end of file From 01d56f9139668a47cbc75816189d2e6fd58eb5b4 Mon Sep 17 00:00:00 2001 From: davidmoina