From 695cdc78e72464613769e0b3b6c607d1409fdd61 Mon Sep 17 00:00:00 2001
From: monica-reverte
";
+
+print "Print instruction
";
+
+$letters = ['a','b','c','d','e'];
+print_r ($letters);
+
+
+?>
\ No newline at end of file
From b9979eb1a8b536c6da6fa350aebfd0dffb2169a0 Mon Sep 17 00:00:00 2001
From: monica-reverte
";
+
+#FOREACH
+
+$a = [1, 2, 3, 17];
+
+foreach ($a as $v) {
+ echo $v;
+}
+
+
+echo "
";
+#WHILE
+
+$number = 1;
+
+while($number < 10) {
+
+ echo $number;
+ $number++;
+
+}
+
+
+echo "
";
+
+#DO WHILE
+
+
+$n = 1;
+do {
+ echo $n;
+ $n++;
+
+} while ($n <= 5);
+
+
+?>
\ No newline at end of file
diff --git a/print.php b/print.php
index 0d13c4b..9817f9c 100644
--- a/print.php
+++ b/print.php
@@ -1,9 +1,15 @@
", "Second echo instruction
";
+#PRINT
+
print "Print instruction
";
+#PRINT_R
+
$letters = ['a','b','c','d','e'];
print_r ($letters);
From 67111352c62ca52c38bf83cd60e4c9fcdd91d70d Mon Sep 17 00:00:00 2001
From: monica-reverte
";
+
+var_dump($x - $y);
+echo "
";
+
+var_dump($x * $y);
+echo "
";
+
+var_dump($x % $y);
+echo "
";
+
+#COMPARISON OPERATORS
+
+#Equal
+
+var_dump($x == $y);
+echo "
";
+
+#Not equal
+
+var_dump($x != $y);
+echo "
";
+
+#Less than
+
+var_dump($x < $y);
+echo "
";
+
+#Grater than
+
+var_dump($x > $y);
+echo "
";
+
+#Less than or equal to
+
+var_dump($x <= $y);
+echo "
";
+
+#Grater than or equal to
+
+var_dump($x >= $y);
+echo "
";
+
+#LOGICAL OPERATORS
+
+#And - True if both $x and $y are true
+
+var_dump($x && $y);
+echo "
";
+
+#And - True if both $x and $y are true
+
+var_dump($x and $y);
+echo "
";
+
+#Or - True if either $x or $y is true
+
+var_dump($x || $y);
+echo "
";
+
+#Or - True if either $x or $y is true
+
+var_dump($x or $y);
+echo "
";
+
+#Not - True if $x is not true
+
+var_dump($x ! $y);
+echo "
";
+
+#Xor - True if either $x or $y is true, but not both
+
+var_dump($x xor $y);
+echo "
";
+
+?>
\ No newline at end of file
From eeef2a371134c3291ed10b63f8ebc1e052947e68 Mon Sep 17 00:00:00 2001
From: monica-reverte
';
+
+#CURRENT DAY ANY FORMAT
+
+echo $date->format ('Y-m-d H:i:s');
+echo '
';
+
+#CURRENT DAY
+
+echo $date->format ('D-d');
+echo '
';
+
+#CURRENT MONTH
+
+echo $date->format ('m');
+echo '
';
+
+#CURRENT MINUTE
+
+echo $date->format ('i');
+
+
+
+
+
+
+
+?>
\ No newline at end of file
diff --git a/operators.php b/operators.php
index 921fe92..c61016b 100644
--- a/operators.php
+++ b/operators.php
@@ -81,4 +81,5 @@
var_dump($x xor $y);
echo "
";
-?>
\ No newline at end of file
+?>
+
From 029d5cbfcf56383efbfedfa219324e07399883ec Mon Sep 17 00:00:00 2001
From: monica-reverte
';
+
+#CURRENT MONTH
+
+$currentMonth = $date->format('M');
+
+if ($currentMonth == 'Oct') {
+ print "We are in October";
+} else {
+ print "We are in $currentMonth";
+}
+
+echo '
';
+
+
+
+#CURRENT MINUTE
+
+$currentMinute = $date->format('i');
+
+if ($currentMinute < 10) {
+ print "The current minute is less than 10";
+} else if ($currentMinute > 15) {
+ print "The current minute is more than 15";
+} else {
+ print "Does not meet any conditions";
+}
+echo '
';
+
+#SWITCH
+
+switch ($currentDay) {
+ case 'Mon':
+ echo "Start the week of classes";
+ break;
+
+ case 'Tue':
+ echo "Second day of classes";
+ break;
+
+ case 'Wen':
+ echo "Third day of classes";
+ break;
+
+ case 'Thu':
+ echo "Fourth day of classes";
+ break;
+
+ case 'Wen':
+ echo "Last day of classes";
+ break;
+
+ default:
+ echo "Is weekend";
+ break;
+}
+
+
+
+
+?>
\ No newline at end of file
diff --git a/dates.php b/dates.php
index 2780b9d..e856d45 100644
--- a/dates.php
+++ b/dates.php
@@ -28,9 +28,4 @@
echo $date->format ('i');
-
-
-
-
-
?>
\ No newline at end of file
diff --git a/types.php b/types.php
new file mode 100644
index 0000000..3300703
--- /dev/null
+++ b/types.php
@@ -0,0 +1,21 @@
+
\ No newline at end of file
From 2af0ca0ad90b0bb97f24807f8356981dce62cfcf Mon Sep 17 00:00:00 2001
From: monica-reverte
';
diff --git a/math.php b/math.php
new file mode 100644
index 0000000..468811b
--- /dev/null
+++ b/math.php
@@ -0,0 +1,37 @@
+
";
+
+#ABSOLUTE
+
+var_dump(abs($x));
+echo "
";
+
+#ROUNDED
+
+var_dump(round($x));
+echo "
";
+
+
+#HIGHEST VALUE
+
+echo(max(0, 150, 30, 20, -8, -200));
+echo "
";
+
+#LOWEST VALUE
+
+echo(min(0, 150, 30, 20, -8, -200));
+echo "
";
+
+#RANDOM NUMBER
+
+echo(rand());
+echo "
";
+
+
+
+
+?>
\ No newline at end of file
diff --git a/types.php b/types.php
index 878610d..7758071 100644
--- a/types.php
+++ b/types.php
@@ -5,21 +5,29 @@
$x = true;
$y = false;
+echo "
";
+
#INTEGRER - non decimal number between -2,147,483,648 and 2,147,483,647
$x = 5985;
var_dump($x);
+echo "
";
+
#FLOAT - is a number with a decimal point or a number in exponential form
$x = 10.365;
var_dump($x);
+echo "
";
+
#STRING
echo 'this is a simple string';
+echo "
";
+
#ARRAY
$cars = array("Volvo","BMW","Toyota");
@@ -30,16 +38,20 @@
"bar" => "foo",
];
+echo "
";
+
#OBJECT
$fruits = (object)[
- "fruit 1" => "mango"
- "fruit 2" => "apple"
- "fruit 3" => "kiwi"
+ "fruit 1" => "mango",
+ "fruit 2" => "apple",
+ "fruit 3" => "kiwi",
];
var_dump($fruits);
+echo "
";
+
#NULL
@@ -47,6 +59,8 @@
$x = null;
var_dump($x);
+echo "
";
+
?>
\ No newline at end of file
From ddf760d99804b211b013fe060d978654714b32b2 Mon Sep 17 00:00:00 2001
From: monica-reverte
';
diff --git a/strings.php b/strings.php
new file mode 100644
index 0000000..23c7009
--- /dev/null
+++ b/strings.php
@@ -0,0 +1,78 @@
+
";
+
+#TEXT VARIABLE
+
+echo "I said " . $txt . "
";
+
+
+#CONCATENATE
+
+$txt2 = "World";
+
+echo "I said " . $txt . " " . $txt2;
+
+echo "
";
+
+#CASE SENSITIVE
+$txt3 = "My car is white";
+echo str_replace("white", "red", $txt3);
+echo "
";
+
+#REPLACE TEXT IN A STRING
+
+$txt4 = "My car is WHITE";
+echo str_ireplace("white", "red", $txt3);
+echo "
";
+
+#WRITE TEXT N TIMES
+
+$txt5 = "It's sunny day
";
+
+echo str_repeat($txt5, 3);
+echo "
";
+
+
+#OBTAIN THE LENGTH
+
+echo strlen($txt);
+echo "
";
+
+
+#OBTAIN POSITION
+
+echo strpos($txt2, "o");
+echo "
";
+
+#CAPITALIZED
+
+$txtU = strtoupper($txt);
+echo $txtU;
+echo "
";
+
+#LOWERCASE
+$txt2L = strtolower($txt2);
+echo $txt2L;
+echo "
";
+
+#OBTAIN TEXT SUBSTRING FROM A GIVEN POSITION
+
+echo substr($txt, -3);
+echo "
";
+
+
+
+
+
+
+
+
+
+
+?>
\ No newline at end of file
From 4e02139feccc26d80e720f6e61c1173c6470a3ed Mon Sep 17 00:00:00 2001
From: monica-reverte
";
+
+#SIMPLE ARRAY NUMBERS
+
+$numbers = [1,2,3,4,5];
+var_dump($numbers);
+echo "
";
+
+
+
+#MULTIDIMENSIONAL ARRAY
+
+$multiArr = [[1, 2], [2, 3], [4, 5]];
+var_dump ($multiArr);
+echo "
";
+
+#LENGTH ARRAY
+
+$length = count($multiArr);
+var_dump($length);
+echo "
";
+
+#COMBINATION ARRAYS
+
+$combi = array_merge($numbers, $fruits);
+var_dump($combi);
+echo "
";
+
+
+#RETURN LAST NUMBER
+
+$lastN = end($numbers);
+var_dump($lastN);
+echo "
";
+
+
+
+#ADD NEW ELEMENT
+
+$newE = array_push($fruits, "orange");
+var_dump($newE);
+echo "
";
+
+
+
+
+?>
\ No newline at end of file
From da0bc042425e57edbfc00a215a8ea063d5899f50 Mon Sep 17 00:00:00 2001
From: monica-reverte
";
+
+#FUNCTION MULTIPLICATION
+
+function multiply($x, $y) {
+ return $x * $y;
+}
+echo multiply(2, 4);
+echo "
";
+
+
+#FUNCTION DIVISION
+
+function division($x, $y) {
+ return $x / $y;
+}
+echo division(4, 2);
+echo "
";
+
+
+
+#OPERATION
+
+function operation($x, $y, $op)
+{
+ switch ($op) {
+ case "+":
+ return sum($x, $y);
+ break;
+ case "*":
+ return multiply($x, $y);
+ break;
+ case "/":
+ return division($x, $y);
+ break;
+ default:
+ return "Error";
+ break;
+ }
+}
+
+echo operation(4, 2, "/");
+echo "
";
+
+
+
+
+
+?>
\ No newline at end of file
From 30cda960e569781b0de6ba5dec030f89edaa56c8 Mon Sep 17 00:00:00 2001
From: monica-reverte
+- Understand how to use Xampp
+- Improve GitHub
## Technologies used
\* PHP
-## Project delivery
+## Organization
+
+- Understand pill
+- Install Xampp
+- Create differents blanks of content
+- Write README
+- Do de pull request
-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
- [What can PHP do?](https://www.php.net/manual/es/intro-whatcando.php)
- [Sample guide for README](https://gist.github.com/Villanuevand/6386899f70346d4580c723232524d35a)
+- [PHP Tutorials](https://www.w3schools.com/php/)
- [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)
+
diff --git a/phpinfo.php b/phpinfo.php
new file mode 100644
index 0000000..9782ad8
--- /dev/null
+++ b/phpinfo.php
@@ -0,0 +1,14 @@
+
\ No newline at end of file
From 2dd2574aa28753855e9d7d488d135ec872f004d3 Mon Sep 17 00:00:00 2001
From: monica-reverte