diff --git a/arrays.php b/arrays.php
new file mode 100644
index 0000000..4e83d50
--- /dev/null
+++ b/arrays.php
@@ -0,0 +1,37 @@
+";
+
+$arrayNumbers = array(1,2,4,5);
+$arrayNumbers2 = array(5,2,2,2);
+print_r($arrayNumbers);
+echo "
";
+
+$arrayMultidimentsional = array(1,array(9,8,7),4,5.3);
+print_r($arrayMultidimentsional);
+echo "
";
+
+echo count($arrayMultidimentsional);
+echo "
";
+
+print_r(array_merge($arrayString,$arrayNumbers));
+echo "
";
+print_r(array_combine($arrayString,$arrayNumbers));
+echo "
";
+print_r(array_intersect($arrayNumbers2,$arrayNumbers));
+echo "
";
+print_r(array_diff($arrayNumbers2,$arrayNumbers));
+echo "
";
+// print_r(array_count_values($arrayNumbers2,$arrayNumbers));
+// echo "
";
+
+print_r(end($arrayNumbers));
+echo "
";
+
+array_push($arrayNumbers,8);
+print_r($arrayNumbers);
+echo "
";
+
+?>
\ No newline at end of file
diff --git a/conditionals.php b/conditionals.php
new file mode 100644
index 0000000..e59b868
--- /dev/null
+++ b/conditionals.php
@@ -0,0 +1,44 @@
+ format("M") == "Oct"){
+ echo "We are in October";
+}else {
+ print $dateMonth -> format("M")."
";
+}
+
+$minute = date("i");
+
+if ($minute < 10 ){
+ echo "The current minute is less than 10"."
";
+}else if ($minute > 15 ){
+ echo "the current minute is more than 15"."
";
+}else{
+ echo "does not meet any conditions"."
";
+}
+
+$dayWeek = date("w");
+
+switch ($dayWeek) {
+ case 0:
+ echo "Monday"."
";
+ break;
+ case 1:
+ echo "Tuesday"."
";
+ break;
+ case 2:
+ echo "Wednesday"."
";
+ break;
+ case 3:
+ echo "Thursday"."
";
+ break;
+}
+
+?>
\ No newline at end of file
diff --git a/dates.php b/dates.php
new file mode 100644
index 0000000..5a11ecb
--- /dev/null
+++ b/dates.php
@@ -0,0 +1,9 @@
+ format('Y-m-d')."
";
+echo $fecha -> format('d')."
";
+echo $fecha -> format('m')."
";
+echo $fecha -> format('i')."
";
+
+?>
\ No newline at end of file
diff --git a/functions.php b/functions.php
new file mode 100644
index 0000000..021c59c
--- /dev/null
+++ b/functions.php
@@ -0,0 +1,50 @@
+";
+
+function plus($arg_1,$arg_2){
+ echo "Funcion de ejemplo";
+ return print($arg_1 * $arg_2);
+ }
+
+ plus(2,5)
+ echo "
";
+
+function div($arg_1,$arg_2){
+ echo "Funcion de ejemplo";
+ return print($arg_1 / $arg_2);
+ }
+
+ div(30,2);
+ echo "
";
+
+
+function multi($arg_1,$arg_2,$variable){
+ switch ($variable) {
+ case 'suma':
+ suma($arg_1,$arg_2);
+ break;
+ case 'plus':
+ plus($arg_1,$arg_2);
+ break;
+ case 'div':
+ div($arg_1,$arg_2);
+ break;
+ }
+ return $arg_1 / $arg_2;
+ }
+
+multi (1,2,"suma");
+echo "
";
+multi (5,2,"plus");
+echo "
";
+multi (10,2,"div");
+echo "
";
+
+?>
\ No newline at end of file
diff --git a/iterators.php b/iterators.php
new file mode 100644
index 0000000..62a2575
--- /dev/null
+++ b/iterators.php
@@ -0,0 +1,33 @@
+";
+
+$numeros = array (1,2,3,4);
+
+foreach ($numeros as &$value)
+
+ print "the number is: $value
";
+
+$x=0;
+while ($x < 10){
+ print "the number is $x
";
+ $x++;
+}
+
+echo "
"; +$a = array ('a' => 'apple', 'b' => 'banana', 'c' => array ('x', 'y', 'z')); + +print_r ($a); +echo ""; + +?> \ No newline at end of file diff --git a/strings.php b/strings.php new file mode 100644 index 0000000..74a6591 --- /dev/null +++ b/strings.php @@ -0,0 +1,31 @@ + \ No newline at end of file diff --git a/types.php b/types.php new file mode 100644 index 0000000..c7a3194 --- /dev/null +++ b/types.php @@ -0,0 +1,54 @@ +