diff --git a/.buildpath b/.buildpath new file mode 100644 index 0000000..8bcb4b5 --- /dev/null +++ b/.buildpath @@ -0,0 +1,5 @@ + + + + + diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..f53fb92 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/nbproject/private/ diff --git a/.project b/.project new file mode 100644 index 0000000..1b37df4 --- /dev/null +++ b/.project @@ -0,0 +1,22 @@ + + + PHP_DS_Project + + + + + + org.eclipse.wst.validation.validationbuilder + + + + + org.eclipse.dltk.core.scriptbuilder + + + + + + org.eclipse.php.core.PHPNature + + diff --git a/index.php b/index.php index 952497c..464e9c9 100644 --- a/index.php +++ b/index.php @@ -1,7 +1,8 @@ - \ No newline at end of file diff --git a/nbproject/project.properties b/nbproject/project.properties new file mode 100644 index 0000000..6774095 --- /dev/null +++ b/nbproject/project.properties @@ -0,0 +1,7 @@ +include.path=${php.global.include.path} +php.version=PHP_83 +source.encoding=UTF-8 +src.dir=. +tags.asp=false +tags.short=false +web.root=. diff --git a/nbproject/project.xml b/nbproject/project.xml new file mode 100644 index 0000000..3cc6bc1 --- /dev/null +++ b/nbproject/project.xml @@ -0,0 +1,9 @@ + + + org.netbeans.modules.php.project + + + DS_PhpProject + + + diff --git a/odkladiste.php b/odkladiste.php new file mode 100644 index 0000000..5e32ca6 --- /dev/null +++ b/odkladiste.php @@ -0,0 +1,128 @@ +"; +// Pravda, nepravda = true, false +$kolej = false; +$adult = false; + +$is_logged = true; +$database_connection = false; + +echo "Přihlášení uživatele: $is_logged"; +echo "
"; +echo "Napojení do databáze: $database_connection"; + +// Null +$kolej = null; +echo $kolej; + +$kolej = "Nebelvír"; +echo $kolej; + +// Matematické operace +$students_2022 = 100; +$students_2023 = 124; + +$results = $students_2022 - $students_2023 * 5; +$results2 = $students_2022 + $students_2023; +$results3 = $students_2022 * $students_2023 ; +$results4 = $students_2022 / $students_2023; +echo "Výsledek: $results"; +echo "
"; +echo "Výsledek: $results2"; +echo "
"; +echo "Výsledek: $results3"; +echo "
"; +echo "Výsledek: $results4"; + +// Spojování proměnných +$first_name = "Harry"; +$second_name = "Potter"; +$friend_first_name = "Ron"; + +echo $first_name . " " . $second_name; +echo "
"; +echo $first_name. " a " .$friend_first_name; + +// Type conversion +$year_price = "1500"; +$year_caunt = "7"; + +$results_price = $year_price * $year_caunt; + +echo $results_price; +echo "
"; +var_dump($results_price); +echo "
"; +var_dump($year_caunt); + +// Negace +$database_connection1 = true; +var_dump(!$database_connection1); + +// Pole (array) + +$students = ["Harry", "Ron", "Hermiona"]; +$students2 = [1 => "Harry", 65 => "Ron", "Hermiona"]; + +echo $students[1]; +echo "
"; +var_dump($students); +echo "
"; +var_dump($students2); + +// Asociatvní pole + +$students3 = [ + "first_name" => "Harry", + "second_name" => "Potter", + "college" => "Nebelvír", + "age" => 15 +]; +echo $students3["second_name"]; + +// Dvoudimenzionální pole (pole v poli) +$students4 = [ + [ + "first_name" => "Harry", + "second_name" => "Potter", + "age" => 15 + ], + ["first_name" => "Hermiona", + "second_name" => "Grangerová", + "age" => 14 + ], + ["first_name" => "Ron", + "second_name" => "Weasly", + "age" => 15], +]; +var_dump($students4); +echo "
"; +echo $students4[0]["first_name"]; +echo "
"; +echo $students4[2]["second_name"]; + +// Foreach cyklus +$students5 = ["Harry", "Ron", "Hermiona", "Malfoy"]; +foreach ($students5 as $index => $one_student5) { + $index++; + echo $index.". " . $one_student5; + echo "
"; + + // Foreach cyklus + $students6 = [ + "jmeno" => "Harry", + "prijmeni" => "Potter", + "kolej" => "Nebelvír", + "vek" => 15 + ]; + + foreach ($students6 as $index1 => $one_information) { + echo $index1.": ".$one_information; + echo "
"; + }; +} \ No newline at end of file