title
PHP For Absolute Beginners | 6.5 Hour Course

description
This course is for absolute beginners and will give you a great kickstart to learning PHP. We'll first talk about what PHP is and why we should learn it, then we will setup a working environment and start coding This video covers all the basics: - How to declare Variables - How to work with strings, Arrays - How to work with file System - How to use cURL to fetch resources - Object Oriented PHP - Namespaces - Composer - Autoloading and much more... At the end of this course we will create a CRUD (CREATE, READ, UPDATE, DELETE) application 3 times. First, we will create it as beginner and see what PHP code looks like without best practices, then we will refactor our application and make it more optimal. We will learn how to use composer, autoloading and we'll create a mini MVC framework with custom routing and then build the final version of our CRUD application using the framework Code: Initial Source files: https://bit.ly/3jmfETf Final Source files: https://bit.ly/3dS9BEx The Codeholic YouTube Channel: https://www.youtube.com/channel/UC_UMEcP_kF0z4E6KbxCpV1w Official Docs: Numbers - https://bit.ly/2IMwiih Strings - https://bit.ly/2T3Prht Arrays - https://bit.ly/2H5NU8i File System - https://bit.ly/3jcjHkE Timestamps: 00:00:00 - Introduction 00:02:45 - Course Overview 00:06:19 - What is PHP and why you should learn it? 00:09:02 - Setup working environment 00:22:45 - PHP Syntax 00:25:50 - Comments 00:26:58 - Variables 00:35:45 - Numbers 00:47:53 - Strings 01:01:07 - Arrays 01:14:09 - Associative Arrays 01:21:44 - Conditionals (If-else, switch) 01:30:59 - Loops 01:38:22 - Functions 01:45:43 - Dates 01:50:36 - Including files 01:58:43 - Working with File System 02:08:01 - OOP 02:25:46 - cURL 02:33:53 - Start working on Products CRUD (bad version) 02:42:05 - Setup connection to database 02:45:36 - Select & display products from MySql 02:52:28 - Products CRUD: Creating Product functionality 02:56:50 - $_GET & $_POST 03:04:04 - Save data in MySql 03:13:45 - Form Validation 03:21:10 - Uploading Image 03:39:37 - Delete Product 03:46:01 - Update Product 03:58:22 - Product Search 04:02:24 - Improve Products CRUD: Code refactoring 04:38:30 - Namespaces & Autoloading with composer 04:49:10 - Install packages using composer 04:53:10 - MVC Framework with Custom Routing 04:56:15 - MVC Controllers 05:13:10 - MVC Views 05:31:25 - MVC Models 06:02:13 - Setup Apache Virtual Hosts 06:11:07 - Sessions 06:20:55 - Cookies

detail
{'title': 'PHP For Absolute Beginners | 6.5 Hour Course', 'heatmap': [{'end': 1402.182, 'start': 924.345, 'weight': 0.884}, {'end': 8372.437, 'start': 8131.014, 'weight': 0.838}, {'end': 9762.185, 'start': 9293.499, 'weight': 1}, {'end': 10693.267, 'start': 9982.781, 'weight': 0.817}, {'end': 11621.547, 'start': 11383.207, 'weight': 0.872}, {'end': 12086.083, 'start': 11853.402, 'weight': 0.704}, {'end': 13945.493, 'start': 12781.94, 'weight': 0.752}], 'summary': 'A 6.5-hour php course for absolute beginners, covering setting up a working environment, working with variables, loops, efl statements, functions, dates, file systems, sessions, cookies, array manipulation, error handling, object-oriented programming, mysql, pdo, form submission, validation, file uploads, web development concepts, refactoring code, and implementing php features, including creating a custom mini mvc framework and managing apache virtual hosts.', 'chapters': [{'end': 154.253, 'segs': [{'end': 60.314, 'src': 'embed', 'start': 30.468, 'weight': 0, 'content': [{'end': 34.731, 'text': 'how to work with dates, file system, how to work with sessions and cookies.', 'start': 30.468, 'duration': 4.263}, {'end': 36.492, 'text': 'and many other minor things.', 'start': 35.131, 'duration': 1.361}, {'end': 43.038, 'text': "but more importantly, we're going to build the products crud application and we're going to build that application three times.", 'start': 36.492, 'duration': 6.546}, {'end': 50.705, 'text': "first we're going to build like a very beginner would build and we basically don't pay attention how well we write the code.", 'start': 43.038, 'duration': 7.667}, {'end': 54.268, 'text': 'so we will have code repetition and very unoptimal code.', 'start': 50.705, 'duration': 3.563}, {'end': 60.314, 'text': "but the main thing is to build that application which will be working, and we're going to achieve that goal.", 'start': 54.548, 'duration': 5.766}], 'summary': 'Learn about dates, file system, sessions, cookies, and building a crud application three times, focusing on beginner-level code and achieving the goal.', 'duration': 29.846, 'max_score': 30.468, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/2eebptXfEvw/pics/2eebptXfEvw30468.jpg'}, {'end': 113.677, 'src': 'embed', 'start': 88.518, 'weight': 1, 'content': [{'end': 94.462, 'text': "after this, we're going to learn modern tools like namespaces, auto loading and composer,", 'start': 88.518, 'duration': 5.944}, {'end': 99.325, 'text': "and using that tools we're going to build a custom mini mvc framework.", 'start': 94.462, 'duration': 4.863}, {'end': 105.189, 'text': "yes, we're going to have controllers, models and views, and based on that mini mvc framework,", 'start': 99.325, 'duration': 5.864}, {'end': 113.677, 'text': "we're going to rebuild the product squad application third time, but in this case the approach, how we build will be completely different,", 'start': 105.189, 'duration': 8.488}], 'summary': 'Learn modern tools, build custom mini mvc framework, rebuild product squad application with different approach', 'duration': 25.159, 'max_score': 88.518, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/2eebptXfEvw/pics/2eebptXfEvw88518.jpg'}, {'end': 156.934, 'src': 'embed', 'start': 131.795, 'weight': 2, 'content': [{'end': 137.701, 'text': 'All the source code which I write in this video is available on my GitHub and you can find the link in the video description.', 'start': 131.795, 'duration': 5.906}, {'end': 142.865, 'text': 'Before I start, I want to say huge thanks to Brad Traversy for two main reasons.', 'start': 138.061, 'duration': 4.804}, {'end': 147.69, 'text': 'Inspiring me in many many things and having me on his channel.', 'start': 143.346, 'duration': 4.344}, {'end': 154.253, 'text': "When I started my own YouTube channel two years ago, I couldn't even dream about creating content for Traverse Media,", 'start': 148.03, 'duration': 6.223}, {'end': 156.934, 'text': "but today I'm here and I'm probably the happiest man.", 'start': 154.253, 'duration': 2.681}], 'summary': 'Youtuber expresses gratitude to brad traversy for inspiration and opportunity, credits him for current success.', 'duration': 25.139, 'max_score': 131.795, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/2eebptXfEvw/pics/2eebptXfEvw131795.jpg'}], 'start': 7.11, 'title': 'Php for absolute beginners', 'summary': 'Introduces a php course for absolute beginners, covering setting up a working environment, working with variables, loops, efl statements, functions, dates, file systems, sessions, cookies, and building a product crud application three times with increasing optimization and modern tools, culminating in the development of a custom mini mvc framework.', 'chapters': [{'end': 154.253, 'start': 7.11, 'title': 'Php for absolute beginners', 'summary': 'Introduces a php course for absolute beginners covering topics like setting up a working environment, working with variables, loops, efl statements, functions, dates, file systems, sessions, cookies, and building a product crud application three times with increasing optimization and modern tools, culminating in the development of a custom mini mvc framework.', 'duration': 147.143, 'highlights': ['The course covers setting up a working environment, working with variables, loops, EFL statements, functions, dates, file systems, sessions, cookies, and building a product CRUD application three times with increasing optimization and modern tools. The course covers a wide range of topics including setting up a working environment, working with variables, loops, EFL statements, functions, dates, file systems, sessions, cookies, and building a product CRUD application three times with increasing optimization and modern tools.', 'The third version of the product CRUD application will be built based on a custom mini MVC framework, showcasing a completely different approach to coding in PHP. The third version of the product CRUD application will be built based on a custom mini MVC framework, showcasing a completely different approach to coding in PHP.', "The source code is available on the instructor's GitHub for reference and practice. The source code is available on the instructor's GitHub for reference and practice."]}], 'duration': 147.143, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/2eebptXfEvw/pics/2eebptXfEvw7110.jpg', 'highlights': ['The course covers setting up a working environment, working with variables, loops, EFL statements, functions, dates, file systems, sessions, cookies, and building a product CRUD application three times with increasing optimization and modern tools.', 'The third version of the product CRUD application will be built based on a custom mini MVC framework, showcasing a completely different approach to coding in PHP.', "The source code is available on the instructor's GitHub for reference and practice."]}, {'end': 3396.723, 'segs': [{'end': 198.729, 'src': 'embed', 'start': 171.981, 'weight': 4, 'content': [{'end': 176.062, 'text': "So first of all, I'm going to explain what is PHP and why we should learn it.", 'start': 171.981, 'duration': 4.081}, {'end': 179.463, 'text': "Then we're going to download and set up working environment.", 'start': 176.562, 'duration': 2.901}, {'end': 181.363, 'text': "We're going to write hello world.", 'start': 179.803, 'duration': 1.56}, {'end': 188.885, 'text': "We're going to learn after that how to write comments, how to declare variables and what data types exist in PHP.", 'start': 181.903, 'duration': 6.982}, {'end': 194.447, 'text': "after that we're going to learn some numbers and string functions, how to declare numbers,", 'start': 189.765, 'duration': 4.682}, {'end': 198.729, 'text': 'how to declare strings and a couple of functions working with that.', 'start': 194.447, 'duration': 4.282}], 'summary': 'Introduction to php, setting up environment, writing hello world, learning data types, numbers and string functions.', 'duration': 26.748, 'max_score': 171.981, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/2eebptXfEvw/pics/2eebptXfEvw171981.jpg'}, {'end': 459.343, 'src': 'embed', 'start': 411.854, 'weight': 0, 'content': [{'end': 419.479, 'text': "It's multi-purpose scripting language, meaning that we can build simple websites on PHP, as well as some complex ones, some CRM systems,", 'start': 411.854, 'duration': 7.625}, {'end': 422.02, 'text': 'some e-commerce systems, REST APIs.', 'start': 419.479, 'duration': 2.541}, {'end': 429.245, 'text': 'We can even use PHP for building some image, video, and audio manipulation software.', 'start': 422.301, 'duration': 6.944}, {'end': 436.967, 'text': 'so it works fine with almost all databases, including non-relational databases as well.', 'start': 429.645, 'duration': 7.322}, {'end': 439.528, 'text': "it's very easy to set up, very easy to learn.", 'start': 436.967, 'duration': 2.561}, {'end': 447.251, 'text': 'it has a very large community and on PHP there is written a lot of very popular CMSs and frameworks.', 'start': 439.528, 'duration': 7.723}, {'end': 453.314, 'text': 'like the WordPress, for example, which is written on PHP, is the most popular CMS in the world out there.', 'start': 447.251, 'duration': 6.063}, {'end': 459.343, 'text': "so there are many other popular cms's on php, such as magento, drupal, opencart.", 'start': 453.314, 'duration': 6.029}], 'summary': "Php is a versatile scripting language for building websites, crm systems, e-commerce systems, rest apis, and more. it is easy to set up, learn, and works with various databases. it's the foundation for popular cmss like wordpress, magento, drupal, and opencart.", 'duration': 47.489, 'max_score': 411.854, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/2eebptXfEvw/pics/2eebptXfEvw411854.jpg'}, {'end': 517.493, 'src': 'embed', 'start': 487.143, 'weight': 2, 'content': [{'end': 492.907, 'text': 'There are many other popular frameworks on PHP like Symfony, Codeigniter, E2 Framework.', 'start': 487.143, 'duration': 5.764}, {'end': 494.449, 'text': 'All of them are absolutely great.', 'start': 493.047, 'duration': 1.402}, {'end': 500.054, 'text': 'And one last but not the least reason why you might need to learn PHP.', 'start': 495.269, 'duration': 4.785}, {'end': 505.8, 'text': 'why you should learn is that there is quite high demand on job market regarding PHP.', 'start': 500.054, 'duration': 5.746}, {'end': 517.493, 'text': 'Okay, so we should also mention that PHP is not probably the best language for building real-time chat applications and artificial intelligence and machine learning.', 'start': 506.741, 'duration': 10.752}], 'summary': 'Php has high demand in job market, not ideal for real-time chat or ai/ml.', 'duration': 30.35, 'max_score': 487.143, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/2eebptXfEvw/pics/2eebptXfEvw487143.jpg'}, {'end': 663.146, 'src': 'embed', 'start': 633.809, 'weight': 3, 'content': [{'end': 638.132, 'text': "so i'm not gonna click, actually, but you have to download for your operating system.", 'start': 633.809, 'duration': 4.323}, {'end': 638.632, 'text': 'down below.', 'start': 638.132, 'duration': 0.5}, {'end': 643.356, 'text': 'we have the uh for linux exam for linux and we also have for mac os.', 'start': 638.632, 'duration': 4.724}, {'end': 645.637, 'text': 'So just download for your OS.', 'start': 644.036, 'duration': 1.601}, {'end': 649.279, 'text': 'Right here I have the downloaded XAMPP, PHPStorm and VS Code.', 'start': 645.877, 'duration': 3.402}, {'end': 652.1, 'text': "And let's go ahead and install XAMPP first.", 'start': 649.579, 'duration': 2.521}, {'end': 656.863, 'text': 'So XAMPP, as I mentioned, is a package that contains Apache, MySQL and PHP.', 'start': 652.64, 'duration': 4.223}, {'end': 663.146, 'text': 'Apache is a web server which is necessary to process PHP files and send output to the browser.', 'start': 657.363, 'duration': 5.783}], 'summary': 'Download xampp for linux and mac os. install xampp with apache, mysql, and php for web server functionality.', 'duration': 29.337, 'max_score': 633.809, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/2eebptXfEvw/pics/2eebptXfEvw633809.jpg'}, {'end': 1402.182, 'src': 'heatmap', 'start': 924.345, 'weight': 0.884, 'content': [{'end': 931.192, 'text': "probably it will write some red text that the it couldn't start and then you need to google find out.", 'start': 924.345, 'duration': 6.847}, {'end': 932.173, 'text': 'it can be.', 'start': 931.192, 'duration': 0.981}, {'end': 937.319, 'text': "it can happen because of multiple reasons, so there's no single answer on that.", 'start': 932.173, 'duration': 5.146}, {'end': 940.742, 'text': "okay, and let's start mysql as well.", 'start': 937.839, 'duration': 2.903}, {'end': 944.325, 'text': 'okay, and the mysql starts on port 3306.', 'start': 940.742, 'duration': 3.583}, {'end': 951.351, 'text': "now let's open browser and in the browser we're going to test if the installation of apache is running.", 'start': 944.325, 'duration': 7.026}, {'end': 953.913, 'text': "so i'm going to type localhost in the browser.", 'start': 951.351, 'duration': 2.562}, {'end': 959.518, 'text': 'hit the enter and if we see welcome to xampp page, this is all what we need.', 'start': 953.913, 'duration': 5.605}, {'end': 963.582, 'text': 'so we have apache installed successfully and it can process php files.', 'start': 959.518, 'duration': 4.064}, {'end': 966.743, 'text': "let's also check if mysql is running.", 'start': 964.082, 'duration': 2.661}, {'end': 970.064, 'text': "so i'm going to type localhost php.", 'start': 966.743, 'duration': 3.321}, {'end': 979.148, 'text': 'my admin hit the enter and we should be able to see the web-based client application to interact with mysql.', 'start': 970.064, 'duration': 9.084}, {'end': 981.189, 'text': 'so here we have it.', 'start': 979.148, 'duration': 2.041}, {'end': 986.691, 'text': 'now we need to make php command available from command prompt.', 'start': 981.189, 'duration': 5.502}, {'end': 995.024, 'text': 'so if we just open right now command prompt and type there php-v.', 'start': 986.691, 'duration': 8.333}, {'end': 1000.43, 'text': 'This prints PHP is not recognized as an internal or external command.', 'start': 995.464, 'duration': 4.966}, {'end': 1005.736, 'text': 'Okay To make this working, we need to open the XAMPP installation folder.', 'start': 1001.01, 'duration': 4.726}, {'end': 1009.191, 'text': 'Go to the PHP folder.', 'start': 1007.13, 'duration': 2.061}, {'end': 1013.572, 'text': 'And this is the folder basically, which contains the PHP executable file.', 'start': 1009.611, 'duration': 3.961}, {'end': 1017.554, 'text': 'So if we scroll down right here, we see php.exe.', 'start': 1013.912, 'duration': 3.642}, {'end': 1026.156, 'text': 'Okay So we need to copy the following path and go to this PC, right click and properties.', 'start': 1017.854, 'duration': 8.302}, {'end': 1040.738, 'text': 'go to advanced system settings, environment variables, click on path and edit, and right here we need to add that php executable path.', 'start': 1027.627, 'duration': 13.111}, {'end': 1046.563, 'text': "okay, i'm gonna paste this c drive xmphp and click ok.", 'start': 1040.738, 'duration': 5.825}, {'end': 1057.051, 'text': "and right here we need to also click ok, just the window is behind the taskbar, so i'm gonna click that using keyboard.", 'start': 1046.563, 'duration': 10.488}, {'end': 1076.842, 'text': "okay, click ok, right here, close that and let's just open right now command prompt, And if we type PHP-V, this prints PHP 7.4..", 'start': 1057.051, 'duration': 19.791}, {'end': 1080.103, 'text': 'So we will need that PHP comment to be available.', 'start': 1076.842, 'duration': 3.261}, {'end': 1083.524, 'text': "And we're going to use that later in this course.", 'start': 1080.183, 'duration': 3.341}, {'end': 1092.788, 'text': "I'm going to also show you how you can make your XAMPP services, Apache and MySQL services run as services.", 'start': 1084.325, 'duration': 8.463}, {'end': 1096.729, 'text': "Okay So let's go to the XAMPP installation again.", 'start': 1093.408, 'duration': 3.321}, {'end': 1102.244, 'text': 'scroll down and find exam control access.', 'start': 1099.082, 'duration': 3.162}, {'end': 1105.526, 'text': "so right now i'm gonna close that.", 'start': 1102.244, 'duration': 3.282}, {'end': 1116.534, 'text': "actually, i'm gonna stop this both of them and close the control panel and i'm gonna open the exam control using right click and run as administrator.", 'start': 1105.526, 'duration': 11.008}, {'end': 1118.335, 'text': 'okay, we have to agree on this.', 'start': 1116.534, 'duration': 1.801}, {'end': 1125.35, 'text': 'And now it shows that red X is next to Apache and MySQL.', 'start': 1120.143, 'duration': 5.207}, {'end': 1133.802, 'text': 'Okay Because we run this as an administrator, we have possibility to enable the services and just click on them.', 'start': 1125.891, 'duration': 7.911}, {'end': 1140.878, 'text': 'okay and the service is basically basically installed.', 'start': 1137.236, 'duration': 3.642}, {'end': 1149.641, 'text': 'and if we go to the config and tick the checkboxes right now apache and mysql and click save,', 'start': 1140.878, 'duration': 8.763}, {'end': 1157.585, 'text': 'so this basically means that whenever we restart our machine, apache and mysql will be automatically started.', 'start': 1149.641, 'duration': 7.944}, {'end': 1161.586, 'text': 'okay, so now i can start them back.', 'start': 1157.585, 'duration': 4.001}, {'end': 1162.647, 'text': 'just we had it before.', 'start': 1161.586, 'duration': 1.061}, {'end': 1166.29, 'text': 'And here we have it.', 'start': 1164.609, 'duration': 1.681}, {'end': 1170.471, 'text': 'Now we need to download the source files, which we need to work on.', 'start': 1167.09, 'duration': 3.381}, {'end': 1183.815, 'text': "So let's go to the following link github.com the code holic slash PHP crash course, 2020.", 'start': 1170.932, 'duration': 12.883}, {'end': 1188.117, 'text': 'So that is the repository, which we have to download.', 'start': 1183.815, 'duration': 4.302}, {'end': 1194.719, 'text': 'On the master branch, we have the initial files, which we need to download and follow.', 'start': 1188.517, 'duration': 6.202}, {'end': 1200.401, 'text': 'And if you want to see the final files, you can find these in the final version right here.', 'start': 1195.259, 'duration': 5.142}, {'end': 1206.683, 'text': "So I'm going to click that code button and download zip right here.", 'start': 1200.841, 'duration': 5.842}, {'end': 1208.864, 'text': "So I'm going to open that.", 'start': 1207.023, 'duration': 1.841}, {'end': 1214.535, 'text': "And I'm going to actually move these in a specific folder.", 'start': 1211.414, 'duration': 3.121}, {'end': 1221.217, 'text': "So let's go to the C drive example where our examples installed and HT docs.", 'start': 1214.855, 'duration': 6.362}, {'end': 1223.738, 'text': "Okay And I'm going to paste these right here.", 'start': 1221.597, 'duration': 2.141}, {'end': 1229.36, 'text': 'So this HT docs folder corresponds to local host in the browser.', 'start': 1224.178, 'duration': 5.182}, {'end': 1236.482, 'text': "So let's type local host right here once again, and the local host basically corresponds to the HT docs folder.", 'start': 1229.7, 'duration': 6.782}, {'end': 1239.883, 'text': "So I'm going to extract these right now, right here.", 'start': 1236.862, 'duration': 3.021}, {'end': 1245.617, 'text': "and i'm going to also uh, just close this.", 'start': 1242.834, 'duration': 2.783}, {'end': 1248.86, 'text': "i'm going to also rename this and remove that master.", 'start': 1245.617, 'duration': 3.243}, {'end': 1254.346, 'text': "okay, open that and there's nested one more nesting level.", 'start': 1248.86, 'duration': 5.486}, {'end': 1262.154, 'text': "so i'm going to basically take out everything and put it right here and delete that master empty folder.", 'start': 1254.346, 'duration': 7.808}, {'end': 1271.759, 'text': 'now, if i type php crash course 2020 in the browser next to the localhost right here.', 'start': 1262.714, 'duration': 9.045}, {'end': 1273.46, 'text': "so let's do this.", 'start': 1271.759, 'duration': 1.701}, {'end': 1280.124, 'text': 'we will see all the files which are inside that php crash crash course 2020.', 'start': 1273.46, 'duration': 6.664}, {'end': 1287.248, 'text': 'okay, these are all the files and from now on, if we open one of the php files from here,', 'start': 1280.124, 'duration': 7.124}, {'end': 1291.611, 'text': 'this will be processed by apache and it will give us output in the browser.', 'start': 1287.248, 'duration': 4.363}, {'end': 1292.331, 'text': 'Okay.', 'start': 1292.031, 'duration': 0.3}, {'end': 1301.393, 'text': "So now let's open that folder using the PHPStorm and start writing hello world.", 'start': 1292.751, 'duration': 8.642}, {'end': 1303.894, 'text': 'So open folder is PHPStorm.', 'start': 1301.993, 'duration': 1.901}, {'end': 1305.754, 'text': "Let's wait a couple of seconds.", 'start': 1304.374, 'duration': 1.38}, {'end': 1308.795, 'text': "I'm going to actually minimize this.", 'start': 1306.835, 'duration': 1.96}, {'end': 1311.836, 'text': "Let's move this on the right side.", 'start': 1309.995, 'duration': 1.841}, {'end': 1316.117, 'text': "I can't move this on the right side for some reason.", 'start': 1311.856, 'duration': 4.261}, {'end': 1324.72, 'text': 'So PHPStorm compared to VS Code is a little bit heavier.', 'start': 1319.997, 'duration': 4.723}, {'end': 1333.286, 'text': "So if you don't have a very good working machine, the VS Code will probably be better in terms of performance.", 'start': 1325.241, 'duration': 8.045}, {'end': 1343.573, 'text': 'If you have a good machine, good PC, then the difference between the VS Code and the PHPStorm in terms of performance is not that big.', 'start': 1333.866, 'duration': 9.707}, {'end': 1348.816, 'text': "So I'm running this in a virtual box, so that's why it's working slightly slow.", 'start': 1344.313, 'duration': 4.503}, {'end': 1353.058, 'text': "Let's open this and here we have it.", 'start': 1350.077, 'duration': 2.981}, {'end': 1359.241, 'text': 'So on the right side, we have the browser on the left side, we have the PHPStorm with all the source files we need.', 'start': 1353.499, 'duration': 5.742}, {'end': 1363.543, 'text': "Okay Now let's start introducing syntax of PHP.", 'start': 1359.521, 'duration': 4.022}, {'end': 1368.188, 'text': "Okay, let's write hello world in PHP.", 'start': 1365.467, 'duration': 2.721}, {'end': 1373.61, 'text': 'First of all, you probably noticed that my phpStorm design is slightly different from yours.', 'start': 1368.628, 'duration': 4.982}, {'end': 1376.21, 'text': "That's because I have just installed theme.", 'start': 1374.05, 'duration': 2.16}, {'end': 1388.514, 'text': "Okay, let's open syntax.html on the left side in the phpStorm and we need to open the following file in the browser as well, right here,", 'start': 1377.391, 'duration': 11.123}, {'end': 1389.855, 'text': 'which prints hello world.', 'start': 1388.514, 'duration': 1.341}, {'end': 1402.182, 'text': 'so, in order to make the php working and inject and embed in our html file, we have to first change the extension from html into php.', 'start': 1390.555, 'duration': 11.627}], 'summary': 'Setting up xampp, testing apache and mysql, adding php to command prompt, and downloading php source files for local testing and development.', 'duration': 477.837, 'max_score': 924.345, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/2eebptXfEvw/pics/2eebptXfEvw924345.jpg'}, {'end': 1673.801, 'src': 'embed', 'start': 1644.763, 'weight': 5, 'content': [{'end': 1646.744, 'text': 'So PHP is loosely typed language.', 'start': 1644.763, 'duration': 1.981}, {'end': 1650.086, 'text': "And whenever you declare a variable, you don't specify the type.", 'start': 1647.065, 'duration': 3.021}, {'end': 1657.33, 'text': 'And the variables have dynamic types, which change the type based on the value, whatever you assign to it.', 'start': 1650.466, 'duration': 6.864}, {'end': 1662.133, 'text': 'In order to declare a variable, you need to use the dollar sign.', 'start': 1658.811, 'duration': 3.322}, {'end': 1664.855, 'text': 'Dollar sign and then the variable name.', 'start': 1662.673, 'duration': 2.182}, {'end': 1673.801, 'text': 'Variable must start with a letter or underscore and after that it can contain digits as well.', 'start': 1665.355, 'duration': 8.446}], 'summary': 'Php is a loosely typed language with dynamic variables, declared using a dollar sign.', 'duration': 29.038, 'max_score': 1644.763, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/2eebptXfEvw/pics/2eebptXfEvw1644763.jpg'}, {'end': 1731.006, 'src': 'embed', 'start': 1698.893, 'weight': 6, 'content': [{'end': 1707.836, 'text': 'so the name right now has a dynamically taken type based on the value and the name has type of string.', 'start': 1698.893, 'duration': 8.943}, {'end': 1712.178, 'text': "age dynamically took a type of that value and it's an integer.", 'start': 1707.836, 'duration': 4.342}, {'end': 1717.5, 'text': 'so in PHP there are several ways, several types.', 'start': 1712.178, 'duration': 5.322}, {'end': 1719.861, 'text': 'so here are the types in PHP.', 'start': 1717.5, 'duration': 2.361}, {'end': 1726.004, 'text': 'so string, integer, float, boolean, null, array, object and resource.', 'start': 1719.861, 'duration': 6.143}, {'end': 1731.006, 'text': "so now I'm going to declare five variables with different types right here.", 'start': 1726.004, 'duration': 5.002}], 'summary': 'Php has multiple data types including string, integer, float, boolean, null, array, object, and resource. the speaker plans to declare five variables with different types.', 'duration': 32.113, 'max_score': 1698.893, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/2eebptXfEvw/pics/2eebptXfEvw1698893.jpg'}, {'end': 1951.524, 'src': 'embed', 'start': 1924.989, 'weight': 7, 'content': [{'end': 1931.276, 'text': 'And right here we see that this variable is a string with a length of four and this is the variable.', 'start': 1924.989, 'duration': 6.287}, {'end': 1939.419, 'text': 'Okay, so this var dump function is super useful when working with large variables like the arrays or the objects.', 'start': 1931.716, 'duration': 7.703}, {'end': 1942.24, 'text': 'So it prints out all the information you need.', 'start': 1939.779, 'duration': 2.461}, {'end': 1949.863, 'text': "Okay, let's print age as well and is male and salary and hate.", 'start': 1943.241, 'duration': 6.622}, {'end': 1951.524, 'text': 'Okay, refresh.', 'start': 1950.223, 'duration': 1.301}], 'summary': 'Using var_dump to display string variable with length 4; useful for large arrays/objects; printing multiple variables.', 'duration': 26.535, 'max_score': 1924.989, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/2eebptXfEvw/pics/2eebptXfEvw1924989.jpg'}, {'end': 2008.303, 'src': 'embed', 'start': 1981.775, 'weight': 8, 'content': [{'end': 1986.302, 'text': 'Okay, let me show you a couple of useful functions when working with variables.', 'start': 1981.775, 'duration': 4.527}, {'end': 1990.868, 'text': 'So, for example, if I want to check a specific variable is a string or not,', 'start': 1986.742, 'duration': 4.126}, {'end': 1997.578, 'text': 'I will use isString and specify the variable name and it will evaluate into true or false.', 'start': 1990.868, 'duration': 6.71}, {'end': 2003.981, 'text': 'In this case, because we changed the name variable and assigned false to it, this will evaluate into false.', 'start': 1998.118, 'duration': 5.863}, {'end': 2006.402, 'text': 'So the name is not string.', 'start': 2004.601, 'duration': 1.801}, {'end': 2008.303, 'text': 'So we have a couple of other variables.', 'start': 2006.783, 'duration': 1.52}], 'summary': "Demonstrating use of isstring function to check variable type, resulting in false for 'name' variable.", 'duration': 26.528, 'max_score': 1981.775, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/2eebptXfEvw/pics/2eebptXfEvw1981775.jpg'}, {'end': 2088.484, 'src': 'embed', 'start': 2056.855, 'weight': 9, 'content': [{'end': 2059.255, 'text': 'so in php, constant basically is a variable.', 'start': 2056.855, 'duration': 2.4}, {'end': 2062.318, 'text': 'whenever you assign something, you cannot actually change that.', 'start': 2059.255, 'duration': 3.063}, {'end': 2065.639, 'text': "it's not actually in a variable, it's a constant.", 'start': 2062.318, 'duration': 3.321}, {'end': 2070.963, 'text': 'okay, in php, uh, we have to use function define to define a constant.', 'start': 2065.639, 'duration': 5.324}, {'end': 2076.966, 'text': 'you have to specify the constant name, for example pi and the constant value, for example, 3.14.', 'start': 2070.963, 'duration': 6.003}, {'end': 2088.484, 'text': 'okay, and the value basically can be number, it can be boolean, it can be string as well, and in latest versions it can even be arrays.', 'start': 2076.966, 'duration': 11.518}], 'summary': 'In php, constants cannot be changed and are defined using the define function with a constant name and value, such as pi with a value of 3.14, which can be a number, boolean, string, or even an array.', 'duration': 31.629, 'max_score': 2056.855, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/2eebptXfEvw/pics/2eebptXfEvw2056855.jpg'}, {'end': 2250.397, 'src': 'embed', 'start': 2220.025, 'weight': 10, 'content': [{'end': 2230.492, 'text': 'okay?. If I put this a plus b in a parenthesis, first the addition will happen and then the multiplication and we will get the different answer.', 'start': 2220.025, 'duration': 10.467}, {'end': 2238.682, 'text': 'okay?. So basically, all kind of arithmetic operations can be done in PHP, like the addition subtraction.', 'start': 2230.492, 'duration': 8.19}, {'end': 2241.606, 'text': "So I'm going to quickly copy and paste all these things.", 'start': 2238.762, 'duration': 2.844}, {'end': 2243.728, 'text': 'Okay, right here.', 'start': 2241.626, 'duration': 2.102}, {'end': 2250.397, 'text': 'Okay, and the person sign basically means a reminder.', 'start': 2243.748, 'duration': 6.649}], 'summary': 'Php allows various arithmetic operations, including addition, subtraction, and multiplication. the percent sign denotes a remainder.', 'duration': 30.372, 'max_score': 2220.025, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/2eebptXfEvw/pics/2eebptXfEvw2220025.jpg'}, {'end': 2378.464, 'src': 'embed', 'start': 2347.822, 'weight': 11, 'content': [{'end': 2351.706, 'text': "i'm not going to basically explore all of them just to save some time.", 'start': 2347.822, 'duration': 3.884}, {'end': 2354.889, 'text': 'okay, So what about increment operator?', 'start': 2351.706, 'duration': 3.183}, {'end': 2361.694, 'text': 'So increment operator is plus, plus operator, which means that to increase the value of the a by one.', 'start': 2354.909, 'duration': 6.785}, {'end': 2369.878, 'text': 'Okay, there exists two types of increment operator, plus plus, a plus plus, and plus plus a.', 'start': 2362.714, 'duration': 7.164}, {'end': 2378.464, 'text': 'Okay, what are the difference? So whenever you use the variable a, a plus plus, with some other operation like the print, for example.', 'start': 2369.878, 'duration': 8.586}], 'summary': "Explains increment operator's two types and their usage", 'duration': 30.642, 'max_score': 2347.822, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/2eebptXfEvw/pics/2eebptXfEvw2347822.jpg'}, {'end': 2540.529, 'src': 'embed', 'start': 2506.786, 'weight': 13, 'content': [{'end': 2518.093, 'text': "let's say and and this will evaluate into true because it understands what's the actual value of that string and that prints out true.", 'start': 2506.786, 'duration': 11.307}, {'end': 2531.863, 'text': 'however, if i put some string inside that, for example 3g.45, this will evaluate into false, because that is not numeric value anymore.', 'start': 2518.093, 'duration': 13.77}, {'end': 2535.185, 'text': 'okay, i hope this makes sense.', 'start': 2532.963, 'duration': 2.222}, {'end': 2540.529, 'text': "so let's see how we can convert a string value into an integer or float.", 'start': 2535.185, 'duration': 5.344}], 'summary': 'Transcript explains how certain strings evaluate to true or false based on their numeric value.', 'duration': 33.743, 'max_score': 2506.786, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/2eebptXfEvw/pics/2eebptXfEvw2506786.jpg'}, {'end': 2777.387, 'src': 'embed', 'start': 2750.825, 'weight': 14, 'content': [{'end': 2765.399, 'text': "um spaces between these thousands and we don't display the like anything after the two digits, after the decimal separator, and we can have a,", 'start': 2750.825, 'duration': 14.574}, {'end': 2766.62, 'text': 'for example, comma.', 'start': 2765.399, 'duration': 1.221}, {'end': 2775.026, 'text': "so I want to format my number like this okay, for example, so let's use a function which is called a number format.", 'start': 2766.62, 'duration': 8.406}, {'end': 2777.387, 'text': 'so echo number format.', 'start': 2775.026, 'duration': 2.361}], 'summary': 'Formatting numbers using number format function.', 'duration': 26.562, 'max_score': 2750.825, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/2eebptXfEvw/pics/2eebptXfEvw2750825.jpg'}, {'end': 2887.265, 'src': 'embed', 'start': 2857.121, 'weight': 12, 'content': [{'end': 2859.142, 'text': "That's the official PHP documentation.", 'start': 2857.121, 'duration': 2.021}, {'end': 2869.249, 'text': 'And just check out the functions and see how they work so that you know what possibilities you have in PHP when working with numbers.', 'start': 2859.583, 'duration': 9.666}, {'end': 2871.991, 'text': "Okay, there are many others we haven't covered.", 'start': 2869.429, 'duration': 2.562}, {'end': 2875.033, 'text': "Okay, let's move on and talk about strings.", 'start': 2872.751, 'duration': 2.282}, {'end': 2887.265, 'text': "Okay, I'm going to open strings.php, close the others, and I'm going to open also strings.php on the right side right here.", 'start': 2877.938, 'duration': 9.327}], 'summary': 'Introduction to php documentation and functions for numbers and strings.', 'duration': 30.144, 'max_score': 2857.121, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/2eebptXfEvw/pics/2eebptXfEvw2857121.jpg'}, {'end': 3171.144, 'src': 'embed', 'start': 3141.466, 'weight': 15, 'content': [{'end': 3150.508, 'text': 'okay, and we have white spaces on the right side, and this is the result of the r trim, which leaves the white spaces on the left side.', 'start': 3141.466, 'duration': 9.042}, {'end': 3159.676, 'text': 'okay, So str word count, just printouts the number of words in that string, and in this case we have two.', 'start': 3150.508, 'duration': 9.168}, {'end': 3166.342, 'text': 'str rev just reverses that string, and we have the hello world in a reverse order.', 'start': 3160.417, 'duration': 5.925}, {'end': 3171.144, 'text': 'str2-upper converts every letters into an upper case.', 'start': 3167.143, 'duration': 4.001}], 'summary': 'The transcript covers string manipulation functions including r trim, word count, reverse, and upper case conversion, with examples and results.', 'duration': 29.678, 'max_score': 3141.466, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/2eebptXfEvw/pics/2eebptXfEvw3141466.jpg'}], 'start': 154.253, 'title': 'Php fundamentals', 'summary': 'Provides a comprehensive overview of a php course, setting up the working environment, and covering variables, constants, arithmetic operations, math functions, and string manipulation in php.', 'chapters': [{'end': 1157.585, 'start': 154.253, 'title': 'Php course setup and overview', 'summary': 'Provides a comprehensive overview of a php course, covering the course plan, reasons to learn php, setting up the working environment, and configuring necessary software.', 'duration': 1003.332, 'highlights': ['PHP is a versatile language suitable for building simple to complex websites, CRM systems, e-commerce systems, REST APIs, and various software for image, video, and audio manipulation, while being compatible with almost all databases including non-relational databases. PHP is capable of handling a wide range of applications, including simple websites, CRM and e-commerce systems, REST APIs, and software for image, video, and audio manipulation. It also offers compatibility with various databases, including non-relational databases.', 'Popular CMSs and frameworks such as WordPress, Laravel, Symfony, Codeigniter, and E2 Framework are built on PHP, demonstrating its widespread adoption and extensive community support. PHP is the foundation for popular CMSs like WordPress, Laravel, Symfony, Codeigniter, and E2 Framework, showcasing its widespread adoption and strong community support.', 'There is a high demand for PHP skills in the job market, indicating ample opportunities for PHP developers. The job market has a high demand for PHP skills, offering abundant opportunities for PHP developers.', 'The chapter also provides detailed guidance on setting up the working environment, including the installation of PHPStorm, Visual Studio Code, and XAMPP package, as well as configuring Apache and MySQL services to run as services. The chapter offers detailed guidance on setting up the working environment, including the installation of PHPStorm, Visual Studio Code, and XAMPP package. It also covers configuring Apache and MySQL services to run as services.']}, {'end': 1617.471, 'start': 1157.585, 'title': 'Setting up php environment and writing hello world', 'summary': "Covers setting up php environment, downloading source files from github, extracting them to the local server, and writing 'hello world' in php, including syntax and comments.", 'duration': 459.886, 'highlights': ["The chapter covers setting up PHP environment, downloading source files from GitHub, extracting them to the local server, and writing 'Hello World' in PHP. It includes instructions on downloading source files from github.com and extracting them to the local server, as well as a demonstration of writing and executing 'Hello World' in PHP.", "Instructions on downloading source files from github.com and extracting them to the local server are provided. The specific link 'github.com/codeholic/PHP crash course, 2020' is mentioned as the repository to download the initial files from, and a demonstration of moving the extracted files to a specific folder on the local server is given.", "Demonstration of writing and executing 'Hello World' in PHP, including syntax and comments, is provided. The transcript includes step-by-step instructions for writing and executing 'Hello World' in PHP, as well as explanations of PHP syntax and the different ways to declare comments in PHP."]}, {'end': 2056.855, 'start': 1618.291, 'title': 'Php variable declaration', 'summary': 'Explains how to declare variables in php, highlighting the dynamic typing of variables, different variable types in php, and practical usage of echo, concatenation, and special functions like gettype and var_dump to handle variables effectively.', 'duration': 438.564, 'highlights': ['PHP variables are loosely typed, with dynamic types that change based on assigned values; no need to specify types during declaration. PHP is a loosely typed language, allowing dynamic type changes based on assigned values, eliminating the need to specify types during declaration.', 'PHP supports several variable types including string, integer, float, boolean, null, array, object, and resource. PHP supports various variable types such as string, integer, float, boolean, null, array, object, and resource.', 'Demonstrates practical usage of echo statement, concatenation with dot sign, and var_dump function to print and handle variables effectively. Practical demonstrations of using echo statement, concatenation with dot sign, and var_dump function for effective variable handling are provided.', 'Special functions like getType and is_* (e.g., isString, isInteger) are used to determine variable types and checks for declared variables, evaluating into true or false. The usage of special functions like getType and is_* (e.g., isString, isInteger) to determine variable types and checks for declared variables, evaluating into true or false, is explained.']}, {'end': 2459.638, 'start': 2056.855, 'title': 'Php constants and arithmetic operations', 'summary': 'Covers defining constants in php using the define function, accessing and using built-in constants in php, and performing arithmetic operations like addition, subtraction, multiplication, and division on variables, with examples demonstrating the behavior of increment and decrement operators.', 'duration': 402.783, 'highlights': ["Defining constants in PHP using the define function and accessing built-in constants The chapter explains that in PHP, constants are defined using the define function, with examples such as defining the constant 'pi' with a value of 3.14. It also mentions the use of built-in constants like SORT_ASC and PHP_INT_MAX.", 'Performing arithmetic operations on variables in PHP The transcript demonstrates arithmetic operations like addition, subtraction, multiplication, and division on variables, with examples showing the results of these operations, such as 9, 10.2, and 9.8.', 'Explanation of increment and decrement operators in PHP The chapter explains the behavior of increment operators (++) and decrement operators (--) in PHP, including the difference between using the operators before and after the variable, with examples demonstrating the output of these operations.']}, {'end': 3396.723, 'start': 2460.652, 'title': 'Php math functions and string manipulation', 'summary': 'Covers various php math functions such as isfloat, isdouble, isinteger, isnumeric, number formatting, and string manipulation functions like strlength, trim, strwordcount, strrev, strtoupper, strtolower, ucfirst, lcfirst, ucwords, strpos, stripos, substr, strreplace, and strireplace, providing practical examples and explanation of their usage.', 'duration': 936.071, 'highlights': ['The chapter demonstrates the usage of various PHP math functions such as isFloat, isDouble, isInteger, isNumeric, number formatting, and string manipulation functions like strLength, trim, strWordCount, strRev, strToUpper, strToLower, uCFirst, lCFirst, ucwords, strpos, strIpos, substr, strReplace, and strIReplace, providing practical examples and explanation of their usage.', "The function isNumeric is demonstrated with examples showing how it evaluates a string value to determine whether it is numeric, with '3.45' evaluating to true and '3g.45' evaluating to false.", 'The chapter provides examples and explanations of number formatting using the number format function, demonstrating how to format a large number with spaces and a specified number of digits after the decimal separator, along with specifying a thousand separator and a decimal point.', 'Various string manipulation functions like strLength, trim, strWordCount, strRev, strToUpper, strToLower, uCFirst, lCFirst, ucwords, strpos, strIpos, substr, strReplace, and strIReplace are explained and demonstrated with practical examples to showcase their functionality and usage.', 'The chapter also includes a brief introduction to PHP string manipulation, covering the usage of single and double quotations, concatenation, and variable interpolation within strings, providing clear examples and practical insights into their differences and applications.']}], 'duration': 3242.47, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/2eebptXfEvw/pics/2eebptXfEvw154253.jpg', 'highlights': ['PHP is a versatile language suitable for building simple to complex websites, CRM systems, e-commerce systems, REST APIs, and various software for image, video, and audio manipulation, while being compatible with almost all databases including non-relational databases.', 'Popular CMSs and frameworks such as WordPress, Laravel, Symfony, Codeigniter, and E2 Framework are built on PHP, demonstrating its widespread adoption and extensive community support.', 'There is a high demand for PHP skills in the job market, indicating ample opportunities for PHP developers.', 'The chapter also provides detailed guidance on setting up the working environment, including the installation of PHPStorm, Visual Studio Code, and XAMPP package, as well as configuring Apache and MySQL services to run as services.', "The chapter covers setting up PHP environment, downloading source files from GitHub, extracting them to the local server, and writing 'Hello World' in PHP.", 'PHP variables are loosely typed, with dynamic types that change based on assigned values; no need to specify types during declaration.', 'PHP supports several variable types including string, integer, float, boolean, null, array, object, and resource.', 'Demonstrates practical usage of echo statement, concatenation with dot sign, and var_dump function to print and handle variables effectively.', 'Special functions like getType and is_* (e.g., isString, isInteger) are used to determine variable types and checks for declared variables, evaluating into true or false.', 'Defining constants in PHP using the define function and accessing built-in constants.', 'Performing arithmetic operations on variables in PHP.', 'Explanation of increment and decrement operators in PHP.', 'The chapter demonstrates the usage of various PHP math functions such as isFloat, isDouble, isInteger, isNumeric, number formatting, and string manipulation functions like strLength, trim, strWordCount, strRev, strToUpper, strToLower, uCFirst, lCFirst, ucwords, strpos, strIpos, substr, strReplace, and strIReplace, providing practical examples and explanation of their usage.', "The function isNumeric is demonstrated with examples showing how it evaluates a string value to determine whether it is numeric, with '3.45' evaluating to true and '3g.45' evaluating to false.", 'The chapter provides examples and explanations of number formatting using the number format function, demonstrating how to format a large number with spaces and a specified number of digits after the decimal separator, along with specifying a thousand separator and a decimal point.', 'Various string manipulation functions like strLength, trim, strWordCount, strRev, strToUpper, strToLower, uCFirst, lCFirst, ucwords, strpos, strIpos, substr, strReplace, and strIReplace are explained and demonstrated with practical examples to showcase their functionality and usage.', 'The chapter also includes a brief introduction to PHP string manipulation, covering the usage of single and double quotations, concatenation, and variable interpolation within strings, providing clear examples and practical insights into their differences and applications.']}, {'end': 4374.233, 'segs': [{'end': 3429.425, 'src': 'embed', 'start': 3397.283, 'weight': 5, 'content': [{'end': 3399.985, 'text': 'So finally, this gives hello PHP.', 'start': 3397.283, 'duration': 2.702}, {'end': 3406.386, 'text': "okay, that's basically a short list of the functions that is in php.", 'start': 3401.539, 'duration': 4.847}, {'end': 3409.15, 'text': 'in php, there are a lot of a lot of functions.', 'start': 3406.386, 'duration': 2.764}, {'end': 3411.414, 'text': 'so i really encourage you to check out that.', 'start': 3409.15, 'duration': 2.264}, {'end': 3416.641, 'text': "and let's see now a long text, basically multi-line text with some line breaks.", 'start': 3411.414, 'duration': 5.227}, {'end': 3419.002, 'text': 'so here i have a text.', 'start': 3416.641, 'duration': 2.361}, {'end': 3429.425, 'text': "hello, my name is ura, i'm 27, i love my daughter and i want to display this text exactly as it is, with these line breaks.", 'start': 3419.002, 'duration': 10.423}], 'summary': 'Introduction to php functions and multi-line text formatting.', 'duration': 32.142, 'max_score': 3397.283, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/2eebptXfEvw/pics/2eebptXfEvw3397283.jpg'}, {'end': 3480.54, 'src': 'embed', 'start': 3449.018, 'weight': 3, 'content': [{'end': 3452.26, 'text': "and that's basically all of them in a single line.", 'start': 3449.018, 'duration': 3.242}, {'end': 3456.503, 'text': 'okay, in the page source they are on different lines, but you know why?', 'start': 3452.26, 'duration': 4.243}, {'end': 3459.606, 'text': 'because this is the html, how the html works.', 'start': 3456.503, 'duration': 3.103}, {'end': 3468.833, 'text': 'so if i want to reserve that line breaks, there is a special function in our nl to br, which means that new line to br,', 'start': 3459.606, 'duration': 9.227}, {'end': 3472.876, 'text': 'and it creates br tags whenever it finds that new line.', 'start': 3468.833, 'duration': 4.043}, {'end': 3473.676, 'text': 'Okay.', 'start': 3473.416, 'duration': 0.26}, {'end': 3480.54, 'text': 'So if I just print this, I see that this is exactly as I expect, as I want.', 'start': 3473.996, 'duration': 6.544}], 'summary': 'Using nl2br function to preserve line breaks in html.', 'duration': 31.522, 'max_score': 3449.018, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/2eebptXfEvw/pics/2eebptXfEvw3449018.jpg'}, {'end': 3672.667, 'src': 'embed', 'start': 3643.352, 'weight': 4, 'content': [{'end': 3649.676, 'text': 'okay, in the source code we see that the b text, surah, in the b text.', 'start': 3643.352, 'duration': 6.324}, {'end': 3652.058, 'text': 'okay, so that is html entity decode.', 'start': 3649.676, 'duration': 2.382}, {'end': 3653.939, 'text': "so i'm going to open this link right here.", 'start': 3652.378, 'duration': 1.561}, {'end': 3656.16, 'text': 'we have a lot of string functions.', 'start': 3653.939, 'duration': 2.221}, {'end': 3666.244, 'text': 'as always, i encourage you to check out that documentation link and read that functions at least once to understand what is possible in php.', 'start': 3656.16, 'duration': 10.084}, {'end': 3672.667, 'text': "okay, okay, let's move on and talk about arrays.", 'start': 3666.244, 'duration': 6.423}], 'summary': 'Review php documentation for string functions and then move on to arrays.', 'duration': 29.315, 'max_score': 3643.352, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/2eebptXfEvw/pics/2eebptXfEvw3643352.jpg'}, {'end': 3819.013, 'src': 'embed', 'start': 3788.949, 'weight': 8, 'content': [{'end': 3793.512, 'text': 'this is the second element with the index 1 and this is the last element.', 'start': 3788.949, 'duration': 4.563}, {'end': 3799.076, 'text': "okay, so arrays in PHP start with index 0, so that's why this is the 0th element.", 'start': 3793.512, 'duration': 5.564}, {'end': 3800.337, 'text': 'this is the first element.', 'start': 3799.076, 'duration': 1.261}, {'end': 3802.719, 'text': 'this is the second element.', 'start': 3800.337, 'duration': 2.382}, {'end': 3810.945, 'text': 'okay, but if I want to this to be readable and visible nicely in the browser, so I generally use the pre-tags.', 'start': 3802.719, 'duration': 8.226}, {'end': 3819.013, 'text': 'Okay, so pre-opening tag, and right here I use pre-closing tag.', 'start': 3811.525, 'duration': 7.488}], 'summary': 'Php arrays start at index 0, using pre-tags for readability.', 'duration': 30.064, 'max_score': 3788.949, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/2eebptXfEvw/pics/2eebptXfEvw3788949.jpg'}, {'end': 3990.885, 'src': 'embed', 'start': 3940.409, 'weight': 6, 'content': [{'end': 3945.273, 'text': 'so whenever you append it takes the next next index.', 'start': 3940.409, 'duration': 4.864}, {'end': 3952.177, 'text': "okay. So if we want to print the whole length of that area, I'm going to use a count function and specify that fruits.", 'start': 3945.273, 'duration': 6.904}, {'end': 3957.18, 'text': 'This will finally give us a length of four because we have four elements.', 'start': 3952.837, 'duration': 4.343}, {'end': 3963.804, 'text': 'Okay So we see how we can append with the square brackets notation, but there exists a special functions for that as well.', 'start': 3957.92, 'duration': 5.884}, {'end': 3973.771, 'text': 'So, for example, array, underscore, push, we specify the array and we specify the variable, the string,', 'start': 3964.124, 'duration': 9.647}, {'end': 3979.636, 'text': 'the value I want to append and it can be even not a string, but it can be number.', 'start': 3973.771, 'duration': 5.865}, {'end': 3985.34, 'text': 'so in PHP arrays basically can have a different type of values there.', 'start': 3979.636, 'duration': 5.704}, {'end': 3990.885, 'text': 'okay, you can have a mix of numbers and strings and booleans and even sub arrays and everything.', 'start': 3985.34, 'duration': 5.545}], 'summary': 'Using count function to get length of array, array_push for appending, array types in php', 'duration': 50.476, 'max_score': 3940.409, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/2eebptXfEvw/pics/2eebptXfEvw3940409.jpg'}, {'end': 4124.113, 'src': 'embed', 'start': 4094.576, 'weight': 2, 'content': [{'end': 4099.459, 'text': 'and i want to convert this into an array, i have to use function explode.', 'start': 4094.576, 'duration': 4.883}, {'end': 4101.779, 'text': "okay, i'm going to specify the delimiter.", 'start': 4099.459, 'duration': 2.32}, {'end': 4111.487, 'text': "in this case they are like delimited by comma and i'm going to specify the string and that will create an array and return that array.", 'start': 4101.779, 'duration': 9.708}, {'end': 4119.291, 'text': 'so if i just dump the whole array and refresh right here, i see this three elements array.', 'start': 4111.846, 'duration': 7.445}, {'end': 4124.113, 'text': "okay, okay, let's see the vice versa operation.", 'start': 4119.291, 'duration': 4.822}], 'summary': 'Using explode function to convert string into an array, with comma as delimiter.', 'duration': 29.537, 'max_score': 4094.576, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/2eebptXfEvw/pics/2eebptXfEvw4094576.jpg'}, {'end': 4311.223, 'src': 'embed', 'start': 4284.553, 'weight': 0, 'content': [{'end': 4294.017, 'text': "In PHP 7.4, which is right now at the moment of recording this, the latest version, in several months, we're going to expect PHP 8.0.", 'start': 4284.553, 'duration': 9.464}, {'end': 4295.537, 'text': 'In November, it will be released.', 'start': 4294.017, 'duration': 1.52}, {'end': 4298.979, 'text': 'But at the moment, PHP 7.4 is the latest one.', 'start': 4295.857, 'duration': 3.122}, {'end': 4303.72, 'text': 'And there is a better way to merge two arrays.', 'start': 4299.319, 'duration': 4.401}, {'end': 4308.202, 'text': 'New notation, which is called spread operator.', 'start': 4304.08, 'duration': 4.122}, {'end': 4311.223, 'text': "okay, so i'm going to dump all these things.", 'start': 4308.602, 'duration': 2.621}], 'summary': 'Php 8.0 expected in a few months from php 7.4, featuring a new spread operator for merging arrays.', 'duration': 26.67, 'max_score': 4284.553, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/2eebptXfEvw/pics/2eebptXfEvw4284553.jpg'}], 'start': 3397.283, 'title': 'Php functions and arrays basics', 'summary': 'Covers php functions including nl2br and html entities, and php arrays basics including declaration, accessing, adding elements, checking existence, and obtaining length, with examples and explanations. it also includes array manipulation in php, appending and removing elements, merging arrays, and the latest version php 7.4.', 'chapters': [{'end': 3672.667, 'start': 3397.283, 'title': 'Php functions, html line breaks, and html entities', 'summary': 'Covers php functions, html line breaks, and html entities, emphasizing the usage of nl2br and html entities for preserving line breaks and tags in php output.', 'duration': 275.384, 'highlights': ['The chapter emphasizes the usage of nl2br function to preserve line breaks and html entities to preserve tags in PHP output.', 'The chapter demonstrates the usage of html entity decode function to decode html entities and display the original content.', 'The chapter encourages readers to explore the extensive list of PHP string functions and gain a basic understanding of HTML entities for effective PHP programming.']}, {'end': 3990.885, 'start': 3672.667, 'title': 'Php arrays basics', 'summary': 'Covers the basics of php arrays, including declaration, accessing elements by index, adding elements, checking existence, and obtaining the length, with examples and explanations.', 'duration': 318.218, 'highlights': ['PHP arrays can contain a mix of values such as numbers, strings, booleans, and sub arrays. PHP arrays support different types of values, including numbers, strings, booleans, and sub arrays.', 'The count function in PHP can be used to obtain the length of an array. The count function in PHP can be used to determine the length of an array, as demonstrated with an example resulting in a length of four for a specific array.', "Arrays in PHP start with index 0, and accessing elements by an index that doesn't exist results in a warning. Arrays in PHP begin with index 0, and attempting to access an element by an index that doesn't exist triggers a warning, illustrated by an attempt to access element at position three resulting in a warning."]}, {'end': 4374.233, 'start': 3991.565, 'title': 'Php array functions', 'summary': 'Covers array manipulation in php, including appending and removing elements, converting strings to arrays, checking for element existence, searching for element indexes, merging arrays using array_merge and the spread operator, with php 7.4 being the latest version.', 'duration': 382.668, 'highlights': ['PHP 7.4 is the latest version at the moment of recording. This information provides context about the PHP version being discussed.', 'The spread operator is a better way to merge two arrays in PHP 7.4. This highlights the introduction of the spread operator as a more efficient way to merge arrays in PHP 7.4.', 'Using array_merge function to merge arrays in PHP. This explains the process of merging arrays using the array_merge function in PHP.', 'Using array_shift to remove the first element from the array. Demonstrates the use of array_shift to remove the first element from the array.', 'Using explode function to convert a string into an array based on a delimiter. This highlights the usage of the explode function to convert a string into an array based on a specified delimiter.']}], 'duration': 976.95, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/2eebptXfEvw/pics/2eebptXfEvw3397283.jpg', 'highlights': ['The spread operator is a better way to merge two arrays in PHP 7.4.', 'Using array_merge function to merge arrays in PHP.', 'Using explode function to convert a string into an array based on a delimiter.', 'The chapter emphasizes the usage of nl2br function to preserve line breaks and html entities to preserve tags in PHP output.', 'The chapter demonstrates the usage of html entity decode function to decode html entities and display the original content.', 'The chapter encourages readers to explore the extensive list of PHP string functions and gain a basic understanding of HTML entities for effective PHP programming.', 'PHP arrays can contain a mix of values such as numbers, strings, booleans, and sub arrays.', 'The count function in PHP can be used to obtain the length of an array.', "Arrays in PHP start with index 0, and accessing elements by an index that doesn't exist results in a warning.", 'PHP 7.4 is the latest version at the moment of recording.']}, {'end': 5320.483, 'segs': [{'end': 4457, 'src': 'embed', 'start': 4428.762, 'weight': 0, 'content': [{'end': 4438.448, 'text': 'so if i print that fruits array before sorting and after sorting so this is before sorting we see how it changes.', 'start': 4428.762, 'duration': 9.686}, {'end': 4443.971, 'text': 'okay. So if we want to sort that in a reverse order, we have to use rsort.', 'start': 4438.448, 'duration': 5.523}, {'end': 4445.632, 'text': 'Okay Reverse sort.', 'start': 4444.272, 'duration': 1.36}, {'end': 4448.915, 'text': 'And right here we see it in a reverse order.', 'start': 4445.853, 'duration': 3.062}, {'end': 4452.357, 'text': "Okay Let's talk about associative arrays.", 'start': 4449.675, 'duration': 2.682}, {'end': 4457, 'text': 'Okay What is an associative array? Associative array is key value peers.', 'start': 4452.437, 'duration': 4.563}], 'summary': 'Demonstrates sorting arrays and explains associative arrays as key-value pairs.', 'duration': 28.238, 'max_score': 4428.762, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/2eebptXfEvw/pics/2eebptXfEvw4428762.jpg'}, {'end': 4627.109, 'src': 'embed', 'start': 4595.148, 'weight': 3, 'content': [{'end': 4601.352, 'text': 'Okay So in PHP 7.4, there exists null coalescing assignment operator.', 'start': 4595.148, 'duration': 6.204}, {'end': 4607.217, 'text': "So which is a very weird name, but it's very handy feature.", 'start': 4601.473, 'duration': 5.744}, {'end': 4616.342, 'text': "So for example, if I want to check if the person has address, And if the person doesn't have address, I'm going to set the address to unknown.", 'start': 4607.637, 'duration': 8.705}, {'end': 4618.043, 'text': 'So I have to do like this.', 'start': 4616.923, 'duration': 1.12}, {'end': 4624.127, 'text': 'If is set person address.', 'start': 4618.384, 'duration': 5.743}, {'end': 4627.109, 'text': "Okay And I'm going to put not sign right here.", 'start': 4624.607, 'duration': 2.502}], 'summary': 'Php 7.4 introduces null coalescing assignment operator, a handy feature for setting default values.', 'duration': 31.961, 'max_score': 4595.148, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/2eebptXfEvw/pics/2eebptXfEvw4595148.jpg'}, {'end': 4856.908, 'src': 'embed', 'start': 4819.84, 'weight': 1, 'content': [{'end': 4826.602, 'text': "It's very common in PHP to work with two-dimensional arrays, especially when working with databases.", 'start': 4819.84, 'duration': 6.762}, {'end': 4830.907, 'text': "okay, let's have a look at the example of two-dimensional array.", 'start': 4827.202, 'duration': 3.705}, {'end': 4837.094, 'text': "so, for example, i'm going to create todos right here as an array and each of the todo element.", 'start': 4830.907, 'duration': 6.187}, {'end': 4842.982, 'text': "i'm going to make a sub array okay, which will be associative array, and each of the todo element.", 'start': 4837.094, 'duration': 5.888}, {'end': 4856.908, 'text': "I'm going to give title to that which will be TodoTitle1, and give it also completed property which corresponds to true, for example, in this case.", 'start': 4843.382, 'duration': 13.526}], 'summary': 'Working with two-dimensional arrays in php, creating todos with associated arrays.', 'duration': 37.068, 'max_score': 4819.84, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/2eebptXfEvw/pics/2eebptXfEvw4819840.jpg'}, {'end': 4947.933, 'src': 'embed', 'start': 4921.391, 'weight': 2, 'content': [{'end': 4928.077, 'text': 'So, in general, if you have any experience in any programming language if-else statements you know what is an if-else statement right?', 'start': 4921.391, 'duration': 6.686}, {'end': 4931.52, 'text': "So let's see how we can do that in PHP.", 'start': 4928.517, 'duration': 3.003}, {'end': 4935.303, 'text': 'So if, in the parentheses, we write some condition.', 'start': 4931.68, 'duration': 3.623}, {'end': 4939.887, 'text': 'For example, if age equals to 20.', 'start': 4935.483, 'duration': 4.404}, {'end': 4945.531, 'text': 'okay. and then if age equals 20, we just print something, for example one okay.', 'start': 4939.887, 'duration': 5.644}, {'end': 4947.933, 'text': 'so if we have a look in the browser, we see one.', 'start': 4945.531, 'duration': 2.402}], 'summary': "Explaining if-else statements in php with an example of age equals 20, resulting in the output 'one'.", 'duration': 26.542, 'max_score': 4921.391, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/2eebptXfEvw/pics/2eebptXfEvw4921391.jpg'}], 'start': 4374.233, 'title': 'Php array manipulation and error handling', 'summary': 'Covers sorting arrays in php, including examples of using sort(), rsort(), and associative arrays, with a focus on error handling and array manipulation functions. it also explains the shorthand null coalescing operator in php 7.4, demonstrating its usage and features. additionally, it covers two-dimensional arrays, conditionals, and operators such as if-else and ternary operator, providing practical examples and comparisons.', 'chapters': [{'end': 4594.728, 'start': 4374.233, 'title': 'Php arrays and error handling', 'summary': 'Covers sorting arrays in php, including examples of using sort(), rsort(), and associative arrays, with a focus on error handling and array manipulation functions.', 'duration': 220.495, 'highlights': ['Associative arrays and accessing values The chapter extensively covers associative arrays in PHP, showcasing how to create and manipulate key-value pairs, emphasizing the importance of error handling when accessing non-existing keys.', 'Sorting arrays using sort() and rsort() Demonstrates the use of sort() and rsort() functions to sort arrays in PHP, with clear examples and visual representation of the sorted and reversed order of arrays.', 'Error handling and array manipulation functions The chapter provides insights into handling errors, including examples of setting new values in arrays and using array manipulation functions, such as var_dump() and print_r().']}, {'end': 4816.559, 'start': 4595.148, 'title': 'Php 7.4 features: null coalescing operator', 'summary': "Explains the shorthand null coalescing operator in php 7.4 which simplifies checking for the existence of a value and assigning a default if it doesn't exist, demonstrated with examples of checking and assigning address values in an associative array, along with using array functions to retrieve keys and values and sorting by keys or values.", 'duration': 221.411, 'highlights': ["The null coalescing operator (??) in PHP 7.4 simplifies checking for the existence of a value and assigning a default if it doesn't exist. This operator streamlines the process of checking and assigning default values, reducing the need for verbose conditional statements.", "Demonstration of using the shorthand null coalescing operator to check and assign address values in an associative array. The example showcases how the shorthand operator efficiently handles the check for the existence of a value and assigns a default if it doesn't exist, improving code readability and conciseness.", 'Utilizing array functions like array_keys and array_values to retrieve keys and values from an associative array, respectively. The use of array functions demonstrates the efficient retrieval of keys and values from an associative array, showcasing the practical application of PHP functions for array manipulation.', 'Sorting an associative array by keys using ksort and by values using asort. The chapter illustrates the usage of ksort and asort functions to sort an associative array by keys and values, showcasing the versatility of PHP in array manipulation and sorting.']}, {'end': 5320.483, 'start': 4819.84, 'title': 'Php arrays and conditionals', 'summary': 'Covers the creation and manipulation of two-dimensional arrays in php, as well as the usage of conditionals and operators such as if-else, ternary operator, and null coalescing operator, providing practical examples and comparisons.', 'duration': 500.643, 'highlights': ['Creation and manipulation of two-dimensional arrays Demonstration of creating two-dimensional arrays in PHP, including the use of associative arrays and practical examples with TodoTitle1 and TodoTitle2.', 'Usage of if-else statements and multiple conditions Illustration of if-else statements in PHP, along with examples of using multiple conditions and the OR operator for decision making.', 'Comparison of double and triple quotations in PHP Comparison of double and triple quotations in PHP, showcasing how they affect the comparison of values and types, demonstrated through examples with integer and string values.', 'Understanding ternary operator and null coalescing operator Explanation and practical examples of the ternary operator for conditional statements, as well as the use of null coalescing operator to handle falseable values in PHP.']}], 'duration': 946.25, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/2eebptXfEvw/pics/2eebptXfEvw4374233.jpg', 'highlights': ['Demonstrates the use of sort() and rsort() functions to sort arrays in PHP, with clear examples and visual representation of the sorted and reversed order of arrays.', 'The chapter extensively covers associative arrays in PHP, showcasing how to create and manipulate key-value pairs, emphasizing the importance of error handling when accessing non-existing keys.', 'Illustration of if-else statements in PHP, along with examples of using multiple conditions and the OR operator for decision making.', "The null coalescing operator (??) in PHP 7.4 simplifies checking for the existence of a value and assigning a default if it doesn't exist. This operator streamlines the process of checking and assigning default values, reducing the need for verbose conditional statements.", "Demonstration of using the shorthand null coalescing operator to check and assign address values in an associative array. The example showcases how the shorthand operator efficiently handles the check for the existence of a value and assigns a default if it doesn't exist, improving code readability and conciseness.", 'Creation and manipulation of two-dimensional arrays Demonstration of creating two-dimensional arrays in PHP, including the use of associative arrays and practical examples with TodoTitle1 and TodoTitle2.', 'Understanding ternary operator and null coalescing operator Explanation and practical examples of the ternary operator for conditional statements, as well as the use of null coalescing operator to handle falseable values in PHP.', 'Sorting an associative array by keys using ksort and by values using asort. The chapter illustrates the usage of ksort and asort functions to sort an associative array by keys and values, showcasing the versatility of PHP in array manipulation and sorting.']}, {'end': 6300.26, 'segs': [{'end': 5388.801, 'src': 'embed', 'start': 5320.863, 'weight': 0, 'content': [{'end': 5330.289, 'text': 'So if I want, for example, to check if the variable is declared or not, for example, if a name is declared, okay, if name is set,', 'start': 5320.863, 'duration': 9.426}, {'end': 5332.031, 'text': 'then take out the name.', 'start': 5330.289, 'duration': 1.742}, {'end': 5336.093, 'text': 'otherwise take out John, for example, as a name.', 'start': 5332.031, 'duration': 4.062}, {'end': 5338.555, 'text': 'okay, and we can assign this into my name.', 'start': 5336.093, 'duration': 2.462}, {'end': 5346.318, 'text': "okay, and whenever i print this right now it will take join, because we don't have name declared in the current variable.", 'start': 5339.175, 'duration': 7.143}, {'end': 5350.12, 'text': 'right, but there is a shorthand version for that.', 'start': 5346.318, 'duration': 3.802}, {'end': 5356.422, 'text': 'so we can just write name, question mark, question mark and join.', 'start': 5350.12, 'duration': 6.302}, {'end': 5359.884, 'text': 'okay, which means that if name exists, take out the name.', 'start': 5356.422, 'duration': 3.462}, {'end': 5362.165, 'text': "if doesn't exist, take out the join.", 'start': 5359.884, 'duration': 2.281}, {'end': 5365.206, 'text': 'so they are basically equivalent to each other.', 'start': 5362.165, 'duration': 3.041}, {'end': 5367.948, 'text': "okay, let's see switch statement.", 'start': 5365.626, 'duration': 2.322}, {'end': 5376.953, 'text': "so right here i'm going to create a user role variable which will be admin, and let's say that we support other roles as well, like the editor,", 'start': 5367.948, 'duration': 9.005}, {'end': 5379.715, 'text': 'a user and admin as well, of course.', 'start': 5376.953, 'duration': 2.762}, {'end': 5386.9, 'text': "so i'm going to write a switch statement right here switch user role, which checks which takes the user role,", 'start': 5379.715, 'duration': 7.185}, {'end': 5388.801, 'text': 'and we have to write a couple of case statements.', 'start': 5386.9, 'duration': 1.901}], 'summary': 'Explains conditional checks and switch statement in programming.', 'duration': 67.938, 'max_score': 5320.863, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/2eebptXfEvw/pics/2eebptXfEvw5320863.jpg'}, {'end': 5527.793, 'src': 'embed', 'start': 5504.497, 'weight': 4, 'content': [{'end': 5511.279, 'text': 'the while loops, basically are the infinite loops basically sometimes are used in a real programming.', 'start': 5504.497, 'duration': 6.782}, {'end': 5516.28, 'text': "okay, so let's create right here counter which equals to zero.", 'start': 5511.279, 'duration': 5.001}, {'end': 5522.105, 'text': "and i'm going to create a while loop while counter, for example, is less than 10.", 'start': 5516.28, 'duration': 5.825}, {'end': 5524.048, 'text': "let's print the counter.", 'start': 5522.105, 'duration': 1.943}, {'end': 5527.793, 'text': 'okay, and we need to increase that counter.', 'start': 5524.048, 'duration': 3.745}], 'summary': 'Demonstrates usage of while loop to iterate and print counter values up to 10.', 'duration': 23.296, 'max_score': 5504.497, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/2eebptXfEvw/pics/2eebptXfEvw5504497.jpg'}, {'end': 5716.583, 'src': 'embed', 'start': 5681.263, 'weight': 5, 'content': [{'end': 5692.628, 'text': "okay so, and let's just print i, for example, which indicates the counter, and it will give us the same exact output, what we had for while loop.", 'start': 5681.263, 'duration': 11.365}, {'end': 5696.63, 'text': 'okay, so this is how you can write for loops.', 'start': 5692.628, 'duration': 4.002}, {'end': 5700.372, 'text': "So let's see how we can write forage.", 'start': 5697.25, 'duration': 3.122}, {'end': 5705.976, 'text': 'Sometimes forage is very often used with some arrays.', 'start': 5700.733, 'duration': 5.243}, {'end': 5711.959, 'text': 'Okay, so if I have an array right here, For example, fruits array.', 'start': 5706.356, 'duration': 5.603}, {'end': 5716.583, 'text': 'And I want to iterate over the fruits array.', 'start': 5712.78, 'duration': 3.803}], 'summary': 'Demonstrating how to write for loops and iterate over arrays.', 'duration': 35.32, 'max_score': 5681.263, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/2eebptXfEvw/pics/2eebptXfEvw5681263.jpg'}, {'end': 5941.27, 'src': 'embed', 'start': 5907.602, 'weight': 7, 'content': [{'end': 5909.624, 'text': "I'm going to open the next topic, which is functions.", 'start': 5907.602, 'duration': 2.022}, {'end': 5912.567, 'text': "Let's open in the browser as well.", 'start': 5910.805, 'duration': 1.762}, {'end': 5915.049, 'text': 'And okay.', 'start': 5912.927, 'duration': 2.122}, {'end': 5918.072, 'text': "Let's see how we can create functions in PHP.", 'start': 5915.089, 'duration': 2.983}, {'end': 5920.815, 'text': "Okay So I'm going to create a very simple function.", 'start': 5918.252, 'duration': 2.563}, {'end': 5923.637, 'text': 'Hello function.', 'start': 5921.916, 'duration': 1.721}, {'end': 5928.342, 'text': 'Hello, which simply outputs.', 'start': 5923.757, 'duration': 4.585}, {'end': 5931.344, 'text': 'Hello I am Zura.', 'start': 5928.802, 'duration': 2.542}, {'end': 5941.27, 'text': "Okay Now, the syntax basically of the function declaration is pretty much the same in JavaScript, for example, if you're familiar.", 'start': 5931.685, 'duration': 9.585}], 'summary': "The topic covered is functions in php, with a demonstration of creating a simple function that outputs 'hello i am zura'.", 'duration': 33.668, 'max_score': 5907.602, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/2eebptXfEvw/pics/2eebptXfEvw5907602.jpg'}, {'end': 5984.725, 'src': 'embed', 'start': 5958.141, 'weight': 12, 'content': [{'end': 5968.171, 'text': 'The purpose of the function is to avoid some code repetition and have a reusable piece of code, which can be used from different places.', 'start': 5958.141, 'duration': 10.03}, {'end': 5972.295, 'text': 'Also, we can pass arguments to that function.', 'start': 5969.872, 'duration': 2.423}, {'end': 5975.723, 'text': "So let's see a function with the argument.", 'start': 5974.082, 'duration': 1.641}, {'end': 5984.725, 'text': "Right here, I'm going to create another function, hello, but I'm going to comment out this one because we cannot have functions with the same names.", 'start': 5976.103, 'duration': 8.622}], 'summary': 'Create reusable function to avoid code repetition with arguments.', 'duration': 26.584, 'max_score': 5958.141, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/2eebptXfEvw/pics/2eebptXfEvw5958141.jpg'}, {'end': 6148.535, 'src': 'embed', 'start': 6117.777, 'weight': 11, 'content': [{'end': 6123.841, 'text': 'okay?. Save that and refresh right here and we see that array okay?', 'start': 6117.777, 'duration': 6.064}, {'end': 6127.224, 'text': 'so i have a challenge for you.', 'start': 6124.762, 'duration': 2.462}, {'end': 6138.47, 'text': 'so pause the video and write a for loop right here, which will sum up the given numbers and return that sum.', 'start': 6127.224, 'duration': 11.246}, {'end': 6143.793, 'text': 'okay, so just pause the video, do this for several minutes and then come back to see my answer.', 'start': 6138.47, 'duration': 5.323}, {'end': 6148.535, 'text': 'Okay, so, here is my answer.', 'start': 6146.914, 'duration': 1.621}], 'summary': 'Challenge: write a for loop to sum given numbers and return the sum.', 'duration': 30.758, 'max_score': 6117.777, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/2eebptXfEvw/pics/2eebptXfEvw6117777.jpg'}, {'end': 6245.003, 'src': 'embed', 'start': 6185.261, 'weight': 8, 'content': [{'end': 6189.288, 'text': "Okay Let's move on and see arrow functions.", 'start': 6185.261, 'duration': 4.027}, {'end': 6195.059, 'text': 'So arrow function is a new feature added in PHP 7.4.', 'start': 6190.413, 'duration': 4.646}, {'end': 6202.589, 'text': "So in fact, I can, I'm going to take the following sum function and paste right here and just change these using arrow function.", 'start': 6195.059, 'duration': 7.53}, {'end': 6205.733, 'text': "Okay So let's comment all this thing.", 'start': 6202.829, 'duration': 2.904}, {'end': 6211.838, 'text': 'and i want my sum function right here to do the same thing.', 'start': 6207.074, 'duration': 4.764}, {'end': 6217.062, 'text': "but i'm going to use array reduce, array reduce.", 'start': 6211.838, 'duration': 5.224}, {'end': 6228.111, 'text': "so in php there exists also functions like array filter, array map and reduce, and let's see how we can use reduce with the arrow function.", 'start': 6217.062, 'duration': 11.049}, {'end': 6231.493, 'text': 'okay, the array reduce accepts.', 'start': 6228.311, 'duration': 3.182}, {'end': 6233.234, 'text': 'we need to pass two arguments.', 'start': 6231.493, 'duration': 1.741}, {'end': 6239.399, 'text': 'first is the array, for example nums, and second we have to pass the arrow function.', 'start': 6233.234, 'duration': 6.165}, {'end': 6245.003, 'text': 'okay, the arrow function is syntax, is the following fn parentheses.', 'start': 6239.399, 'duration': 5.604}], 'summary': 'Php 7.4 introduces arrow functions, used with array reduce, array filter, and array map.', 'duration': 59.742, 'max_score': 6185.261, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/2eebptXfEvw/pics/2eebptXfEvw6185261.jpg'}], 'start': 5320.863, 'title': 'Variable declaration, shorthand notation, php loops, conditions, and functions', 'summary': 'Discusses variable declaration, shorthand notation for conditional assignment in javascript, and the equivalence of different notations. it also covers creating user roles with a switch statement, demonstrating different loops in php, and creating functions, with an emphasis on avoiding infinite loops and supporting multiple arguments.', 'chapters': [{'end': 5367.948, 'start': 5320.863, 'title': 'Variable declaration and shorthand notation', 'summary': 'Discusses variable declaration, shorthand notation for conditional assignment, and the equivalence of different notations in javascript, emphasizing the use of shorthand notation for more concise code.', 'duration': 47.085, 'highlights': ["The shorthand notation 'name ? name : 'join'' can be used for conditional assignment, where the value of 'name' is taken if it exists, else 'join' is used, providing a more concise alternative for conditional assignments.", "The chapter emphasizes the equivalence of different notations for conditional assignments, demonstrating that 'name ? name : 'join'' is equivalent to 'if-else' conditional statements, promoting the use of shorthand notation for more efficient and concise code.", "The discussion also covers checking variable declaration and conditional assignment in JavaScript, showcasing the practical application of shorthand notation and its equivalence to traditional 'if-else' conditions."]}, {'end': 5907.462, 'start': 5367.948, 'title': 'Php loops and conditions', 'summary': 'Covers creating user roles with a switch statement, demonstrating while loops, for loops, and foreach loops, showcasing their syntax and use cases, with an emphasis on avoiding infinite loops and iterating over arrays.', 'duration': 539.514, 'highlights': ['Demonstrating switch statement for creating user roles with admin, editor, and user, with a default case for an invalid role. The switch statement is used to create user roles such as admin, editor, and user, with a default case to handle invalid roles.', 'Explaining the concept of while loops with a practical example and emphasizing the use of conditions to avoid infinite loops. While loops are explained with an example, highlighting the importance of using conditions to prevent infinite loops.', 'Illustrating the syntax and usage of for loops with a clear example and emphasizing the similarity to while loops in terms of functionality. The syntax and usage of for loops are illustrated with a clear example, emphasizing their similarity to while loops in terms of functionality.', 'Showcasing the application of foreach loops for iterating over arrays, including handling associative arrays and avoiding the issue of array to string conversion. The foreach loop is showcased for iterating over arrays, including handling associative arrays and addressing the issue of array to string conversion.']}, {'end': 6300.26, 'start': 5907.602, 'title': 'Php functions and arrow functions', 'summary': 'Covers creating functions in php, including creating simple functions, passing arguments, returning values, and supporting multiple arguments. it also introduces arrow functions and demonstrates how to use array reduce with arrow functions, resulting in the sum of given numbers.', 'duration': 392.658, 'highlights': ['The chapter covers creating functions in PHP, including creating simple functions, passing arguments, returning values, and supporting multiple arguments.', 'The demonstration of how to use array reduce with arrow functions to sum a given set of numbers using a concise syntax.', 'The explanation of the syntax and functionality of arrow functions, a new feature added in PHP 7.4.', 'The detailed code demonstration of using arrow functions and array reduce to achieve the same result as the previous sum function, showcasing the differences and benefits of arrow functions.', 'The practical example of using a for loop to sum up given numbers and return the sum, providing a hands-on exercise for the audience.', 'The concept of creating functions in PHP to avoid code repetition and enable reusability, emphasizing the practical benefits of using functions in programming.', 'The introduction of the purpose of functions in PHP to avoid code repetition and enable a reusable piece of code, enhancing the understanding of the importance of functions in programming.']}], 'duration': 979.397, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/2eebptXfEvw/pics/2eebptXfEvw5320863.jpg', 'highlights': ["The shorthand notation 'name ? name : 'join'' can be used for conditional assignment, providing a more concise alternative for conditional assignments.", 'The chapter emphasizes the equivalence of different notations for conditional assignments, promoting the use of shorthand notation for more efficient and concise code.', "The discussion covers checking variable declaration and conditional assignment in JavaScript, showcasing the practical application of shorthand notation and its equivalence to traditional 'if-else' conditions.", 'Demonstrating switch statement for creating user roles with admin, editor, and user, with a default case for an invalid role.', 'Explaining the concept of while loops with a practical example and emphasizing the use of conditions to avoid infinite loops.', 'Illustrating the syntax and usage of for loops with a clear example and emphasizing their similarity to while loops in terms of functionality.', 'Showcasing the application of foreach loops for iterating over arrays, including handling associative arrays and avoiding the issue of array to string conversion.', 'The chapter covers creating functions in PHP, including creating simple functions, passing arguments, returning values, and supporting multiple arguments.', 'The demonstration of how to use array reduce with arrow functions to sum a given set of numbers using a concise syntax.', 'The explanation of the syntax and functionality of arrow functions, a new feature added in PHP 7.4.', 'The detailed code demonstration of using arrow functions and array reduce to achieve the same result as the previous sum function, showcasing the differences and benefits of arrow functions.', 'The practical example of using a for loop to sum up given numbers and return the sum, providing a hands-on exercise for the audience.', 'The concept of creating functions in PHP to avoid code repetition and enable reusability, emphasizing the practical benefits of using functions in programming.', 'The introduction of the purpose of functions in PHP to avoid code repetition and enable a reusable piece of code, enhancing the understanding of the importance of functions in programming.']}, {'end': 7675.352, 'segs': [{'end': 6351.196, 'src': 'embed', 'start': 6325.727, 'weight': 3, 'content': [{'end': 6336.21, 'text': 'Okay, then 3 plus 3 will be returned from that function, which will be given to the next iteration as 6, and the n will become 4,', 'start': 6325.727, 'duration': 10.483}, {'end': 6338.63, 'text': 'and so on until the end of the array.', 'start': 6336.21, 'duration': 2.42}, {'end': 6341.011, 'text': 'and finally, this gives us the sum.', 'start': 6338.63, 'duration': 2.381}, {'end': 6343.463, 'text': 'Okay, Okay.', 'start': 6341.611, 'duration': 1.852}, {'end': 6347.75, 'text': "That's basically all about functions I wanted to show to you.", 'start': 6343.664, 'duration': 4.086}, {'end': 6351.196, 'text': "Let's move on and see how we can work with dates in PHP.", 'start': 6347.89, 'duration': 3.306}], 'summary': 'Explanation of function iteration and summing up results. moving on to working with dates in php.', 'duration': 25.469, 'max_score': 6325.727, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/2eebptXfEvw/pics/2eebptXfEvw6325727.jpg'}, {'end': 6978.824, 'src': 'embed', 'start': 6953.836, 'weight': 2, 'content': [{'end': 6959.958, 'text': 'The second usage of including lead files, one of them is including in the HTML.', 'start': 6953.836, 'duration': 6.122}, {'end': 6966.519, 'text': 'And the second way is to have a reusable piece of code, which can be included from different areas.', 'start': 6959.998, 'duration': 6.521}, {'end': 6976.864, 'text': "so, for example, i'm going to go into that functions in the index.php and let's say that i'm developing a math library, for example,", 'start': 6968.84, 'duration': 8.024}, {'end': 6978.824, 'text': "and i'm going to create math.php.", 'start': 6976.864, 'duration': 1.96}], 'summary': 'The transcript discusses two ways of including files: in html and as reusable code, such as a math library.', 'duration': 24.988, 'max_score': 6953.836, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/2eebptXfEvw/pics/2eebptXfEvw6953836.jpg'}, {'end': 7153.735, 'src': 'embed', 'start': 7124.173, 'weight': 0, 'content': [{'end': 7125.814, 'text': 'That is all about including files.', 'start': 7124.173, 'duration': 1.641}, {'end': 7129.998, 'text': "Let's move on on the next topic and see how we can work with the file system.", 'start': 7126.034, 'duration': 3.964}, {'end': 7135.703, 'text': "Okay Let's open that file system folder right here, index.php.", 'start': 7131.079, 'duration': 4.624}, {'end': 7141.188, 'text': "I'm going to close the others and open that on the right side as well.", 'start': 7136.303, 'duration': 4.885}, {'end': 7147.612, 'text': 'uh, right here, fs okay, perfect.', 'start': 7143.85, 'duration': 3.762}, {'end': 7151.714, 'text': "so, first of all, let's explore a couple of magic constants.", 'start': 7147.612, 'duration': 4.102}, {'end': 7153.735, 'text': 'and what are these magic constants?', 'start': 7151.714, 'duration': 2.021}], 'summary': 'Introduction to working with the file system and exploring magic constants', 'duration': 29.562, 'max_score': 7124.173, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/2eebptXfEvw/pics/2eebptXfEvw7124173.jpg'}, {'end': 7235.076, 'src': 'embed', 'start': 7209.227, 'weight': 4, 'content': [{'end': 7218.949, 'text': 'so if i put a couple of enters right here, that magic constant line moves on the next line, seven, and that finally will print right here seven.', 'start': 7209.227, 'duration': 9.722}, {'end': 7220.05, 'text': 'look at this.', 'start': 7218.949, 'duration': 1.101}, {'end': 7221.67, 'text': 'so these are the magic constants.', 'start': 7220.05, 'duration': 1.62}, {'end': 7226.192, 'text': "Okay, let's see how we can create directory in PHP.", 'start': 7222.49, 'duration': 3.702}, {'end': 7235.076, 'text': 'So for this, we have to use a function mkdir, and we have to specify a directory name, test in this case.', 'start': 7226.772, 'duration': 8.304}], 'summary': "Using php, creating a directory named 'test' with function mkdir.", 'duration': 25.849, 'max_score': 7209.227, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/2eebptXfEvw/pics/2eebptXfEvw7209227.jpg'}, {'end': 7460.675, 'src': 'embed', 'start': 7427.092, 'weight': 1, 'content': [{'end': 7436.518, 'text': 'so we specify some file name, for example sample.txt, and we specify content, some content.', 'start': 7427.092, 'duration': 9.426}, {'end': 7443.783, 'text': 'okay, when we execute this, it will create that sample.txt right here.', 'start': 7436.518, 'duration': 7.265}, {'end': 7447.505, 'text': 'here we see, if we open, we see some content right there.', 'start': 7443.783, 'duration': 3.722}, {'end': 7460.675, 'text': 'okay, so we can combine that file get contents and file put contents together and read the content and append something at the bottom and put it in the file put contents.', 'start': 7447.505, 'duration': 13.17}], 'summary': 'Using file_get_contents and file_put_contents to read, append, and write content to a file.', 'duration': 33.583, 'max_score': 7427.092, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/2eebptXfEvw/pics/2eebptXfEvw7427092.jpg'}], 'start': 6301.14, 'title': 'Php functions, date handling, file inclusion, and reusing code in php', 'summary': 'Covers returning values from functions, working with dates, file inclusion using include and require, creating reusable code in php, and using file system functions for directory and file management. it emphasizes practical examples and best practices for efficient code execution.', 'chapters': [{'end': 6614.05, 'start': 6301.14, 'title': 'Php functions and date handling', 'summary': "Covers the concept of returning values from functions and demonstrates how to work with dates in php, including printing the current date, printing yesterday's date, specifying custom date formats, printing the current timestamp, parsing dates, and parsing dates based on a different format.", 'duration': 312.91, 'highlights': ['The demonstration of returning values from functions and carrying over the result for the next iteration is explained, with an example of adding elements in an array to obtain the sum. example of adding elements in an array', "The process of printing the current date, yesterday's date, and specifying custom date formats using the date function is demonstrated, along with the explanation of the timestamp as the number of seconds from January 1, 1970. printing the current date, yesterday's date, specifying custom date formats", 'The utilization of the time function to print the current timestamp and the method to parse dates using the date parse function is illustrated. utilization of the time function, parsing dates using the date parse function', 'The process of parsing dates based on a different format using the date parse from format function is presented, with an example of parsing a date string. parsing dates based on a different format, example of parsing a date string']}, {'end': 6953.496, 'start': 6614.57, 'title': 'Php file inclusion', 'summary': 'Discusses file inclusion in php, emphasizing the use of include and require statements, highlighting the differences and best practices, and showcasing the importance of include once and require once methods.', 'duration': 338.926, 'highlights': ['The chapter explains the concept of including files in PHP and the practical approach of creating separate files for common elements to avoid code duplication, such as creating a header file and using it in multiple PHP files.', 'It highlights the difference between include and require statements, with include allowing the code to continue execution even if the file is not found, while require stops the code execution if the file is not found, emphasizing the importance of require for essential functionality.', 'The chapter demonstrates the use of include once and require once methods to prevent multiple inclusions of the same file, showcasing how PHP checks if the file is already included and avoids re-including it, thereby optimizing the code and avoiding duplication.']}, {'end': 7123.932, 'start': 6953.836, 'title': 'Including and reusing code in php', 'summary': "Discusses the usage of including lead files and creating reusable code in php, emphasizing the importance of using 'require_once' to avoid errors and ensure efficient code execution.", 'duration': 170.096, 'highlights': ["Emphasizes the importance of using 'require_once' to avoid errors and ensure efficient code execution. Using 'require_once' instead of 'include_once' and 'include' prevents redeclaring functions and ensures that the file is only included once.", "Explains the correct usage of 'require' to avoid fatal errors and warnings. Using 'require' and 'require_once' prevents the execution of the rest of the code if the file is not found, resulting in a single error and efficient error handling.", 'Demonstrates the creation of a math library and its inclusion in the index.php file. Illustrates the creation of a math library with functions for addition and subtraction, and its inclusion in the index.php file for use and testing.']}, {'end': 7288.477, 'start': 7124.173, 'title': 'Php file system functions', 'summary': 'Covers the usage of magic constants, creating, renaming, and deleting directories in php, demonstrating the creation of a directory using mkdir(), renaming it with rename(), and deleting it using rmdir().', 'duration': 164.304, 'highlights': ["Demonstrating the creation of a directory using mkdir() The chapter demonstrates the creation of a directory 'test' using the mkdir() function in PHP.", "Renaming a directory with rename() It covers the renaming of the 'test' directory to 'test2' using the rename() function in PHP.", "Deleting a directory using rmdir() It also showcases the deletion of the 'test2' directory using the rmdir() function in PHP.", 'Explanation of magic constants The transcript explains the usage of magic constants like __DIR__, __FILE__, and __LINE__, which change their value based on the execution context in PHP.']}, {'end': 7675.352, 'start': 7289.358, 'title': 'Php file system functions', 'summary': 'Covers file reading, directory listing, writing content to files, fetching data from urls, converting json data, and checking file and directory existence using php functions, with practical examples and usage.', 'duration': 385.994, 'highlights': ['The chapter covers file reading, directory listing, writing content to files, fetching data from URLs, converting JSON data, and checking file and directory existence using PHP functions. It includes practical examples and usage, providing a comprehensive understanding of the PHP file system functions.', "The file get contents function is used to read the content of a file, with a practical example of reading the 'lorem.txt' file and displaying its content. Demonstrates the usage of file get contents function and its ability to read a file's content, reinforcing the practical application of PHP file system functions.", "The scan dir function is utilized to list the directory and display all files and folders inside it, including explanations for the symbols 'dot' and 'double dot'. Provides a practical demonstration of using scan dir function to list the directory's contents, enhancing understanding of directory listing in PHP.", "The file put contents function is showcased by creating a 'sample.txt' file and writing content into it, demonstrating how to write content inside a file using PHP. Illustrates the usage of file put contents function to write content into a file, enhancing comprehension of writing operations in PHP file system functions.", "Fetching data from a URL using file get contents and displaying it, with practical example of fetching data from 'jsonplaceholder' and printing the content. Demonstrates the practical use of file get contents to fetch data from a URL, reinforcing the practical application of PHP file system functions.", "Converting JSON data into an associative array using JSON decode function, with a practical example of converting fetched user's JSON data into an array and displaying it. Demonstrates the practical usage of JSON decode function to convert JSON data into an associative array, reinforcing the practical application of PHP file system functions.", "Demonstrates the usage of file exists function to check if a specific file exists, including practical examples of checking the existence of 'sample.txt' and a non-existing file. Provides practical examples of using file exists function to check the existence of files, enhancing understanding of file existence checks in PHP.", 'The chapter encourages experimentation with PHP file system functions and provides a link for further exploration. Encourages further exploration and experimentation with PHP file system functions, promoting proactive learning and in-depth understanding.']}], 'duration': 1374.212, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/2eebptXfEvw/pics/2eebptXfEvw6301140.jpg', 'highlights': ['Covers file reading, directory listing, writing content to files, fetching data from URLs, converting JSON data, and checking file and directory existence using PHP functions.', 'Demonstrates the usage of file put contents function to write content into a file, enhancing comprehension of writing operations in PHP file system functions.', 'The chapter explains the concept of including files in PHP and the practical approach of creating separate files for common elements to avoid code duplication.', 'The demonstration of returning values from functions and carrying over the result for the next iteration is explained, with an example of adding elements in an array to obtain the sum.', "Demonstrates the creation of a directory using mkdir() The chapter demonstrates the creation of a directory 'test' using the mkdir() function in PHP."]}, {'end': 9006.412, 'segs': [{'end': 7755.514, 'src': 'embed', 'start': 7706.673, 'weight': 8, 'content': [{'end': 7708.735, 'text': 'the class is a blueprint.', 'start': 7706.673, 'duration': 2.062}, {'end': 7715.061, 'text': 'it is a template, okay, you can also think about it as a new data type, okay,', 'start': 7708.735, 'duration': 6.326}, {'end': 7725.991, 'text': 'and out of which we can create a variables of that data type and that variables are called instances or objects, sometimes okay.', 'start': 7715.061, 'duration': 10.93}, {'end': 7727.793, 'text': 'so whenever we create class,', 'start': 7725.991, 'duration': 1.802}, {'end': 7738.682, 'text': 'we define some properties and functionalities of that class and then the instances of that class will have that properties and functionalities.', 'start': 7727.793, 'duration': 10.889}, {'end': 7754.492, 'text': 'okay. for example, if i create a class of person, okay, and that person has a public property name and public property surname and private property age,', 'start': 7738.682, 'duration': 15.81}, {'end': 7755.514, 'text': 'for example.', 'start': 7754.492, 'duration': 1.022}], 'summary': 'A class is a blueprint for creating instances with defined properties and functionalities, such as a person class with public and private properties.', 'duration': 48.841, 'max_score': 7706.673, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/2eebptXfEvw/pics/2eebptXfEvw7706673.jpg'}, {'end': 7844.085, 'src': 'embed', 'start': 7811.108, 'weight': 7, 'content': [{'end': 7816.59, 'text': 'Okay, what does this mean that it is a public or private? So these are called access modifiers.', 'start': 7811.108, 'duration': 5.482}, {'end': 7824.594, 'text': 'There also exists a third access modifier, which is called protected, which is more relevant when we see inheritance.', 'start': 7817.071, 'duration': 7.523}, {'end': 7831.897, 'text': "Okay So I'm going to set right now the name and the surname of that person class.", 'start': 7824.934, 'duration': 6.963}, {'end': 7838.24, 'text': "So I'm going to write here p.name equals bread.", 'start': 7832.397, 'duration': 5.843}, {'end': 7844.085, 'text': 'Okay and p.surname equals Traversy.', 'start': 7838.94, 'duration': 5.145}], 'summary': 'Introduction to access modifiers and setting name and surname in a class.', 'duration': 32.977, 'max_score': 7811.108, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/2eebptXfEvw/pics/2eebptXfEvw7811108.jpg'}, {'end': 7945.557, 'src': 'embed', 'start': 7919.357, 'weight': 13, 'content': [{'end': 7930.945, 'text': 'So constructor is a special function associated to the class, which is called, executed immediately when the instance of that class is created.', 'start': 7919.357, 'duration': 11.588}, {'end': 7935.128, 'text': 'In this case, we create an instance two times.', 'start': 7932.206, 'duration': 2.922}, {'end': 7939.452, 'text': 'Right here, new person, and right here, new person.', 'start': 7935.649, 'duration': 3.803}, {'end': 7941.113, 'text': 'We call these two times.', 'start': 7939.492, 'duration': 1.621}, {'end': 7945.557, 'text': 'So every time we create an instance, that constructor function will be executed.', 'start': 7941.634, 'duration': 3.923}], 'summary': 'Constructor functions are executed immediately when class instances are created, demonstrated by creating two instances in the given example.', 'duration': 26.2, 'max_score': 7919.357, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/2eebptXfEvw/pics/2eebptXfEvw7919357.jpg'}, {'end': 8214.129, 'src': 'embed', 'start': 8187.273, 'weight': 9, 'content': [{'end': 8195.481, 'text': "so i'm going to create right here public static counter, okay, which equals to zero,", 'start': 8187.273, 'duration': 8.208}, {'end': 8200.602, 'text': "and whenever an instance is created i'm going to increase the counter.", 'start': 8195.481, 'duration': 5.121}, {'end': 8203.965, 'text': 'but pay attention to this new keyword which is called static.', 'start': 8200.602, 'duration': 3.363}, {'end': 8210.727, 'text': 'so static properties and static methods belong to the class itself, not the instance.', 'start': 8203.965, 'duration': 6.762}, {'end': 8214.129, 'text': 'okay, not the object created out of that class.', 'start': 8210.727, 'duration': 3.402}], 'summary': 'Static counter incremented for each instance created.', 'duration': 26.856, 'max_score': 8187.273, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/2eebptXfEvw/pics/2eebptXfEvw8187273.jpg'}, {'end': 8388.364, 'src': 'heatmap', 'start': 8131.014, 'weight': 10, 'content': [{'end': 8137.176, 'text': 'okay, and we specify the 30 which will take that age variable and save it in a property.', 'start': 8131.014, 'duration': 6.162}, {'end': 8148.141, 'text': 'so after this, if i print the person, we see that person has an age of 30 and i can create another public function get age,', 'start': 8137.176, 'duration': 10.965}, {'end': 8150.582, 'text': 'which simply will return an age.', 'start': 8148.141, 'duration': 2.441}, {'end': 8155.184, 'text': 'so return this age, and this is called getter.', 'start': 8150.582, 'duration': 4.602}, {'end': 8167.337, 'text': 'okay, and now i can print p, get age, save and refresh that, and we see 30 right here.', 'start': 8155.664, 'duration': 11.673}, {'end': 8177.338, 'text': "okay, let's uncomment now that second person and let's specify right here that john smith in the constructor.", 'start': 8167.337, 'duration': 10.001}, {'end': 8183.807, 'text': 'okay, and we have that second person, p2, save and refresh, and here we have it.', 'start': 8177.338, 'duration': 6.469}, {'end': 8187.273, 'text': "so now let's see static properties and static methods.", 'start': 8183.807, 'duration': 3.466}, {'end': 8195.481, 'text': "so i'm going to create right here public static counter, okay, which equals to zero,", 'start': 8187.273, 'duration': 8.208}, {'end': 8200.602, 'text': "and whenever an instance is created i'm going to increase the counter.", 'start': 8195.481, 'duration': 5.121}, {'end': 8203.965, 'text': 'but pay attention to this new keyword which is called static.', 'start': 8200.602, 'duration': 3.363}, {'end': 8210.727, 'text': 'so static properties and static methods belong to the class itself, not the instance.', 'start': 8203.965, 'duration': 6.762}, {'end': 8214.129, 'text': 'okay, not the object created out of that class.', 'start': 8210.727, 'duration': 3.402}, {'end': 8223.266, 'text': 'okay, if i want to access that static counter, i have to use self keyword, self counter, plus plus.', 'start': 8214.129, 'duration': 9.137}, {'end': 8229.528, 'text': 'so whenever we create an instance of that class, we create, we increase that counter property.', 'start': 8223.266, 'duration': 6.262}, {'end': 8238.27, 'text': "okay, and i'm going to create right here a static function as well public static function.", 'start': 8229.528, 'duration': 8.742}, {'end': 8245.052, 'text': "get counter and i'm going to return self counter.", 'start': 8238.27, 'duration': 6.782}, {'end': 8255.869, 'text': "okay. and now down below, When we created two instances of that Person class, I'm going to print Person class counter.", 'start': 8245.052, 'duration': 10.817}, {'end': 8263.253, 'text': 'So we access two static properties with this double colon.', 'start': 8256.469, 'duration': 6.784}, {'end': 8272.317, 'text': 'Save that and refresh and we see two, which means that the counter is two because two objects are created out of that class, which is quite accurate.', 'start': 8263.612, 'duration': 8.705}, {'end': 8281.486, 'text': "Let's call that getCounter statically using this double colon, save and refresh, and we see two right here.", 'start': 8273.138, 'duration': 8.348}, {'end': 8289.234, 'text': "There are much more to explain about the classes, but I'm not going to cover all of them right here,", 'start': 8282.528, 'duration': 6.706}, {'end': 8293.338, 'text': 'because this is not like the full course about object-oriented PHP.', 'start': 8289.234, 'duration': 4.104}, {'end': 8294.6, 'text': 'These are just basics.', 'start': 8293.539, 'duration': 1.061}, {'end': 8298.12, 'text': "Let's see a couple of other examples like the inheritance.", 'start': 8295.68, 'duration': 2.44}, {'end': 8305.522, 'text': "So I'm going to create a file inside that object-oriented folder and call it person.", 'start': 8299.021, 'duration': 6.501}, {'end': 8311.485, 'text': 'Very often, when we have a class, that class is in its own separate file.', 'start': 8306.003, 'duration': 5.482}, {'end': 8318.689, 'text': "So I'm going to take that person class and move it in that file.", 'start': 8311.924, 'duration': 6.765}, {'end': 8329.018, 'text': 'okay, so here we have it and we can, if we want to use that person class, we have to include it or require it right here.', 'start': 8318.689, 'duration': 10.329}, {'end': 8333.201, 'text': 'in this case, the best example will be to require once right here.', 'start': 8329.018, 'duration': 4.183}, {'end': 8336.645, 'text': 'not include, not include once, but require once.', 'start': 8333.201, 'duration': 3.444}, {'end': 8342.627, 'text': "So I'm including, I'm requiring that person, and this will work in the same way.", 'start': 8337.665, 'duration': 4.962}, {'end': 8344.647, 'text': 'So we have the same output right here.', 'start': 8342.826, 'duration': 1.821}, {'end': 8355.49, 'text': 'Okay So I have, I should also mention that since PHP 7.4, we have possibility to specify the types on the properties.', 'start': 8344.967, 'duration': 10.523}, {'end': 8363.653, 'text': 'So for example, I can write that the name is string, surname is string and age is integer.', 'start': 8355.629, 'duration': 8.024}, {'end': 8368.514, 'text': 'we can also specify that on counter that it is an integer as well.', 'start': 8364.253, 'duration': 4.261}, {'end': 8372.437, 'text': 'okay, that is because of php 7.4.', 'start': 8368.514, 'duration': 3.923}, {'end': 8384.402, 'text': 'so if i declare a variable with the type int, for example, and i want it to be sometimes null values, okay, for example, when i create the instance,', 'start': 8372.437, 'duration': 11.965}, {'end': 8388.364, 'text': 'i want to specify that this age to be null.', 'start': 8384.402, 'duration': 3.962}], 'summary': 'The transcript covers static properties and methods, class inheritance, and type specification in php 7.4.', 'duration': 32.735, 'max_score': 8131.014, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/2eebptXfEvw/pics/2eebptXfEvw8131014.jpg'}, {'end': 8438.607, 'src': 'embed', 'start': 8411.622, 'weight': 5, 'content': [{'end': 8417.156, 'text': "so now i'm going to create a second class, which I'm going to call student.", 'start': 8411.622, 'duration': 5.534}, {'end': 8420.318, 'text': "Okay And let's remove these things.", 'start': 8418.116, 'duration': 2.202}, {'end': 8424.14, 'text': "And I'm going to extend that student from person.", 'start': 8420.558, 'duration': 3.582}, {'end': 8426.221, 'text': "So I'm using inheritance.", 'start': 8424.6, 'duration': 1.621}, {'end': 8430.423, 'text': 'Okay So the student class is a child class of the person.', 'start': 8426.421, 'duration': 4.002}, {'end': 8438.607, 'text': "So first of all, before we are using right here's a person class, we have to write require right here as well.", 'start': 8430.923, 'duration': 7.684}], 'summary': 'Creating a student class extending from person class using inheritance.', 'duration': 26.985, 'max_score': 8411.622, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/2eebptXfEvw/pics/2eebptXfEvw8411622.jpg'}, {'end': 8500.55, 'src': 'embed', 'start': 8467.315, 'weight': 6, 'content': [{'end': 8476.414, 'text': 'okay, but pay attention one thing Right here phpStorm basically tells me that required parameter name is missing.', 'start': 8467.315, 'duration': 9.099}, {'end': 8485.96, 'text': 'So because the student extends the person, the student also has a constructor inside its parent class person.', 'start': 8477.074, 'duration': 8.886}, {'end': 8490.283, 'text': 'Okay And that constructor accepts name and surname.', 'start': 8486.52, 'duration': 3.763}, {'end': 8495.466, 'text': 'So we have to specify name and surname when we create an instance of the student.', 'start': 8490.743, 'duration': 4.723}, {'end': 8500.55, 'text': "Okay Let's create bread traversing.", 'start': 8496.107, 'duration': 4.443}], 'summary': 'Phpstorm indicates missing required parameter name in student constructor, requiring specification of name and surname for student instance creation.', 'duration': 33.235, 'max_score': 8467.315, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/2eebptXfEvw/pics/2eebptXfEvw8467315.jpg'}, {'end': 8782.871, 'src': 'embed', 'start': 8749.298, 'weight': 0, 'content': [{'end': 8751.541, 'text': 'The next topic is CURL.', 'start': 8749.298, 'duration': 2.243}, {'end': 8761.932, 'text': "So I'm going to remove this and close all of that index.php and let's open CURL on the right side as well.", 'start': 8751.861, 'duration': 10.071}, {'end': 8763.914, 'text': 'So here we have it.', 'start': 8763.053, 'duration': 0.861}, {'end': 8774.604, 'text': 'So generally, what is CURL? CURL is a tool which gives you the possibility to interact remotely to other services, to other resources.', 'start': 8764.875, 'duration': 9.729}, {'end': 8779.909, 'text': 'So for example, I want to get the information from the following URL.', 'start': 8775.745, 'duration': 4.164}, {'end': 8782.871, 'text': "So I'm going to use CURL for that.", 'start': 8780.269, 'duration': 2.602}], 'summary': 'Introducing curl, a tool for remote interaction with services and resources.', 'duration': 33.573, 'max_score': 8749.298, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/2eebptXfEvw/pics/2eebptXfEvw8749298.jpg'}, {'end': 8879.569, 'src': 'embed', 'start': 8850.965, 'weight': 1, 'content': [{'end': 8857.809, 'text': 'the resource basically is the following thing okay, which is returned from this url okay,', 'start': 8850.965, 'duration': 6.844}, {'end': 8863.996, 'text': 'so we created that resource and now we want to set a couple of options on that resource.', 'start': 8857.809, 'duration': 6.187}, {'end': 8871.165, 'text': "so i'm going to use crl set opt function specify the resource on which i want to set the option.", 'start': 8863.996, 'duration': 7.169}, {'end': 8879.569, 'text': "i'm going to specify also constant crl opt return transfer, And that corresponds to true.", 'start': 8871.165, 'duration': 8.404}], 'summary': 'Created resource and set options using crl set opt function.', 'duration': 28.604, 'max_score': 8850.965, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/2eebptXfEvw/pics/2eebptXfEvw8850965.jpg'}, {'end': 9006.412, 'src': 'embed', 'start': 8939.123, 'weight': 2, 'content': [{'end': 8948.791, 'text': 'okay, but when we call this url get info, we can also specify crl info, http code.', 'start': 8939.123, 'duration': 9.668}, {'end': 8956.923, 'text': "Okay, H CURL, what's wrong?", 'start': 8953.962, 'duration': 2.961}, {'end': 8962.463, 'text': 'CURL info, HTTP code.', 'start': 8957.503, 'duration': 4.96}, {'end': 8963.964, 'text': 'Okay, this one.', 'start': 8963.104, 'duration': 0.86}, {'end': 8966.684, 'text': 'And finally, this is the response code.', 'start': 8964.504, 'duration': 2.18}, {'end': 8970.385, 'text': "So I'm going to call it code, save and refresh.", 'start': 8967.044, 'duration': 3.341}, {'end': 8973.025, 'text': 'And right here, we see that response code.', 'start': 8971.025, 'duration': 2}, {'end': 8979.866, 'text': 'Okay, so when we make a CURL execution and get the result, then we need to call CURL close.', 'start': 8973.325, 'duration': 6.541}, {'end': 8982.387, 'text': 'Okay, CURL close.', 'start': 8980.267, 'duration': 2.12}, {'end': 8984.369, 'text': "Let's provide the resource.", 'start': 8983.188, 'duration': 1.181}, {'end': 8989.958, 'text': 'After we call that serial resource, we cannot actually get any info on that serial.', 'start': 8984.99, 'duration': 4.968}, {'end': 8993.003, 'text': 'So this code is okay and it works.', 'start': 8990.419, 'duration': 2.584}, {'end': 8999.87, 'text': 'But if I put that serial close before that serial info right here,', 'start': 8993.303, 'duration': 6.567}, {'end': 9006.412, 'text': 'this code returns basically boolean false because the resource is already closed and we cannot read that.', 'start': 8999.87, 'duration': 6.542}], 'summary': 'Using curl to retrieve info and handle http response codes, ensuring proper resource management to avoid errors.', 'duration': 67.289, 'max_score': 8939.123, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/2eebptXfEvw/pics/2eebptXfEvw8939123.jpg'}], 'start': 7675.452, 'title': 'Object-oriented programming and curl basics', 'summary': 'Covers the basics of object-oriented programming in general and in php, including concepts of classes, inheritance, access specifiers, constructors, and practical examples, as well as introduction to using curl to interact with remote services and resources, highlighting its advantages and demonstrating its functions and usage.', 'chapters': [{'end': 7945.557, 'start': 7675.452, 'title': 'Object oriented programming basics', 'summary': 'Covers the basics of object oriented programming, explaining the concepts of a class, instance, properties, and access modifiers, as well as demonstrating the use of constructors, with an example of creating and accessing instances of a person class.', 'duration': 270.105, 'highlights': ['Explanation of a class as a blueprint and its relation to instances or objects. The class is described as a blueprint/template for creating instances/objects, illustrating the concept of a new data type and demonstrating the creation of a class instance.', 'Demonstration of creating and accessing properties of a person class, including public and private properties. The process of creating a person class with public and private properties, and accessing and setting the values for these properties is shown.', 'Illustration of creating multiple instances with different property values and the use of constructors. The concept of creating multiple instances of a person class with different property values and the use of a constructor function with specified arguments is demonstrated.']}, {'end': 8411.622, 'start': 7947.099, 'title': 'Php object-oriented basics', 'summary': 'Covers the basics of object-oriented php, including creating classes, defining properties and methods, using static properties and methods, and specifying types on properties, with a focus on practical examples and explanations.', 'duration': 464.523, 'highlights': ["Creating and using classes with properties and methods The chapter provides practical examples of creating and using classes, defining properties and methods, and using the 'this' keyword to access instance properties, with the example of a Person class with name, surname, and age properties.", "Using static properties and methods The concept of static properties and methods is explained, including the use of 'static' keyword, 'self' keyword to access static properties, and creating a static counter property to count the number of instances created out of a class.", 'Specifying types on properties in PHP 7.4 The chapter introduces the possibility to specify types on properties in PHP 7.4, including specifying types such as string and integer for properties, and using the question mark to indicate that a property can accept null values.']}, {'end': 8747.898, 'start': 8411.622, 'title': 'Object oriented programming in php', 'summary': 'Covers the creation of a student class inheriting from a person class, using inheritance and constructors, and accessing properties with public, protected, and private access specifiers in php.', 'duration': 336.276, 'highlights': ['Creating a student class inheriting from a person class. The speaker demonstrates the creation of a student class that extends the person class, showing the concept of inheritance in object-oriented programming in PHP.', 'Utilizing constructors and passing parameters during class instantiation. The speaker explains the necessity of passing parameters, such as name, surname, and student ID, when creating an instance of the student class using constructors in PHP.', 'Demonstrating the use of public, protected, and private access specifiers for class properties. The speaker illustrates the difference between public, protected, and private access specifiers for class properties, showing how access to these properties varies within and outside the class.']}, {'end': 9006.412, 'start': 8749.298, 'title': 'Introduction to curl', 'summary': 'Discusses the basics of using curl to interact remotely with other services and resources, highlighting its advantages over filegetcontents, and demonstrates how to utilize curl functions to fetch information from a url, set options, execute the request, and retrieve the response code.', 'duration': 257.114, 'highlights': ['CURL is a tool that allows remote interaction with services and resources, offering advantages over FileGetContents, such as bypassing security policies and allowing the use of additional headers and post requests.', 'Demonstrates the use of CURL init function to create a resource and CURL set opt function to set options on the resource, specifying the constant CURL_OPT_RETURN_TRANSFER as true.', 'Shows the execution of the CURL request using CURL exec and retrieving the response as well as the status code using CURL get info function, specifically highlighting the HTTP code.', 'Emphasizes the importance of calling CURL close after executing the request to handle the resource properly and avoid issues with accessing closed resources.', 'Explains the impact of calling CURL close before retrieving information, resulting in a boolean false return due to the resource being already closed.']}], 'duration': 1330.96, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/2eebptXfEvw/pics/2eebptXfEvw7675452.jpg', 'highlights': ['CURL is a tool that allows remote interaction with services and resources, offering advantages over FileGetContents, such as bypassing security policies and allowing the use of additional headers and post requests.', 'Demonstrates the use of CURL init function to create a resource and CURL set opt function to set options on the resource, specifying the constant CURL_OPT_RETURN_TRANSFER as true.', 'Shows the execution of the CURL request using CURL exec and retrieving the response as well as the status code using CURL get info function, specifically highlighting the HTTP code.', 'Emphasizes the importance of calling CURL close after executing the request to handle the resource properly and avoid issues with accessing closed resources.', 'Explains the impact of calling CURL close before retrieving information, resulting in a boolean false return due to the resource being already closed.', 'Creating a student class inheriting from a person class. The speaker demonstrates the creation of a student class that extends the person class, showing the concept of inheritance in object-oriented programming in PHP.', 'Utilizing constructors and passing parameters during class instantiation. The speaker explains the necessity of passing parameters, such as name, surname, and student ID, when creating an instance of the student class using constructors in PHP.', 'Demonstrating the use of public, protected, and private access specifiers for class properties. The speaker illustrates the difference between public, protected, and private access specifiers for class properties, showing how access to these properties varies within and outside the class.', "Creating and using classes with properties and methods The chapter provides practical examples of creating and using classes, defining properties and methods, and using the 'this' keyword to access instance properties, with the example of a Person class with name, surname, and age properties.", "Using static properties and methods The concept of static properties and methods is explained, including the use of 'static' keyword, 'self' keyword to access static properties, and creating a static counter property to count the number of instances created out of a class.", 'Specifying types on properties in PHP 7.4 The chapter introduces the possibility to specify types on properties in PHP 7.4, including specifying types such as string and integer for properties, and using the question mark to indicate that a property can accept null values.', 'Explanation of a class as a blueprint and its relation to instances or objects. The class is described as a blueprint/template for creating instances/objects, illustrating the concept of a new data type and demonstrating the creation of a class instance.', 'Demonstration of creating and accessing properties of a person class, including public and private properties. The process of creating a person class with public and private properties, and accessing and setting the values for these properties is shown.', 'Illustration of creating multiple instances with different property values and the use of constructors. The concept of creating multiple instances of a person class with different property values and the use of a constructor function with specified arguments is demonstrated.']}, {'end': 11525.57, 'segs': [{'end': 9033.821, 'src': 'embed', 'start': 9006.412, 'weight': 0, 'content': [{'end': 9016.055, 'text': "okay, so now i'm going to make a post request on that endpoint to create a user in the following api okay,", 'start': 9006.412, 'duration': 9.643}, {'end': 9022.256, 'text': "so for this i'm going to create crl init again and in this case i don't pass the url.", 'start': 9016.055, 'duration': 6.201}, {'end': 9024.137, 'text': "i'm going to show you a different approach.", 'start': 9022.256, 'duration': 1.881}, {'end': 9026.138, 'text': 'This returns a resource.', 'start': 9024.677, 'duration': 1.461}, {'end': 9030.84, 'text': "Okay Then I'm going to call cURL setOpt.", 'start': 9026.698, 'duration': 4.142}, {'end': 9033.821, 'text': 'We have setOpt and we have setOptArray.', 'start': 9031.54, 'duration': 2.281}], 'summary': 'Creating a user using a post request on an api, utilizing curl setopt and setoptarray.', 'duration': 27.409, 'max_score': 9006.412, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/2eebptXfEvw/pics/2eebptXfEvw9006412.jpg'}, {'end': 9762.185, 'src': 'heatmap', 'start': 9293.499, 'weight': 1, 'content': [{'end': 9301.375, 'text': "okay, let's start, and first we have to create database in mysql and we have to create products table.", 'start': 9293.499, 'duration': 7.876}, {'end': 9310.662, 'text': "so i'm going to open right now phpMyAdmin, which is a web-based client for MySQL, and we have to create a database.", 'start': 9301.375, 'duration': 9.287}, {'end': 9315.326, 'text': 'So on the left side, right here, we have existing databases.', 'start': 9311.722, 'duration': 3.604}, {'end': 9320.43, 'text': 'So I have a little bit more probably you have if you have a fresh new installation of XAMPP.', 'start': 9315.906, 'duration': 4.524}, {'end': 9322.592, 'text': "So let's just create a new one.", 'start': 9320.93, 'duration': 1.662}, {'end': 9323.332, 'text': 'Hit that New.', 'start': 9322.612, 'duration': 0.72}, {'end': 9325.013, 'text': 'right here.', 'start': 9324.133, 'duration': 0.88}, {'end': 9336.798, 'text': "let's just call this products underscore, crud, and i'm going to choose utf-8, mb4, unicode ci, which works best for me in all.", 'start': 9325.013, 'duration': 11.785}, {'end': 9340.699, 'text': "uh, in all cases like so, let's just create this.", 'start': 9336.798, 'duration': 3.901}, {'end': 9344.961, 'text': 'and we have to create also table for products.', 'start': 9340.699, 'duration': 4.262}, {'end': 9351.804, 'text': "so i'm going to call the table products and i'm going to add six columns right here and hit, go.", 'start': 9344.961, 'duration': 6.843}, {'end': 9355.105, 'text': 'so the first column, which will be id.', 'start': 9352.704, 'duration': 2.401}, {'end': 9360.687, 'text': "that's going to be an integer and i'm going to tick right here that it is an auto increment.", 'start': 9355.105, 'duration': 5.582}, {'end': 9363.508, 'text': 'so it will also pick up the index primary.', 'start': 9360.687, 'duration': 2.821}, {'end': 9367.049, 'text': "so that's going to be our primary key of the table.", 'start': 9363.508, 'duration': 3.541}, {'end': 9377.012, 'text': "we're going to have title, which will be varchar, okay, and let's give it 512 maximum length, and that should be required.", 'start': 9367.049, 'duration': 9.963}, {'end': 9378.853, 'text': "so i'm not going to tick that checkbox.", 'start': 9377.012, 'duration': 1.841}, {'end': 9380.033, 'text': 'okay, it should be unticked.', 'start': 9378.853, 'duration': 1.18}, {'end': 9386.494, 'text': "so we're going to have description as well, which will be a long text or text.", 'start': 9380.953, 'duration': 5.541}, {'end': 9388.935, 'text': "let's pick up long, long text.", 'start': 9386.494, 'duration': 2.441}, {'end': 9392.235, 'text': "so let's give it a long text.", 'start': 9388.935, 'duration': 3.3}, {'end': 9395.116, 'text': "okay, and right here i'm going to make this optional.", 'start': 9392.235, 'duration': 2.881}, {'end': 9397.136, 'text': 'okay, tick the checkbox.', 'start': 9395.116, 'duration': 2.02}, {'end': 9408.059, 'text': "we're going to also have image, which will be varchar of 2048, and i'm going to make this optional as well.", 'start': 9397.136, 'duration': 10.923}, {'end': 9420.043, 'text': "and we're going to have also price of the product, which i'm going to make decimal of probably 10 by 2, and this is the maximum.", 'start': 9408.059, 'duration': 11.984}, {'end': 9423.184, 'text': "okay, let's give it 10 by 2, but the price should be required.", 'start': 9420.043, 'duration': 3.141}, {'end': 9428.026, 'text': "and i'm going to create the last column, which will be create date.", 'start': 9423.824, 'duration': 4.202}, {'end': 9433.469, 'text': 'so whenever we add the product, this will be picked up and saved in the database automatically.', 'start': 9428.026, 'duration': 5.443}, {'end': 9436.43, 'text': "so i'm going to set this date time.", 'start': 9433.469, 'duration': 2.961}, {'end': 9438.591, 'text': 'okay, so here we have.', 'start': 9436.43, 'duration': 2.161}, {'end': 9440.832, 'text': "let's have a quick overview.", 'start': 9438.591, 'duration': 2.241}, {'end': 9448.146, 'text': "everything looks good, okay, so i'll scroll down and i'm going to hit this save.", 'start': 9440.832, 'duration': 7.314}, {'end': 9452.09, 'text': 'okay, so the table was actually created.', 'start': 9448.146, 'duration': 3.944}, {'end': 9456.253, 'text': "okay, now let's create a couple of records right there.", 'start': 9452.09, 'duration': 4.163}, {'end': 9460.436, 'text': "so i'm going to go into insert and the id will be picked up automatically.", 'start': 9456.253, 'duration': 4.183}, {'end': 9462.298, 'text': "so i'm going to leave this empty.", 'start': 9460.436, 'duration': 1.862}, {'end': 9465.48, 'text': "in title i'm going to write iphone 11, for example.", 'start': 9462.298, 'duration': 3.182}, {'end': 9468.582, 'text': 'this is the first product we are adding In the description.', 'start': 9465.48, 'duration': 3.102}, {'end': 9469.703, 'text': "I'm going to leave empty.", 'start': 9468.582, 'duration': 1.121}, {'end': 9471.583, 'text': "The image, I'm going to leave empty.", 'start': 9470.063, 'duration': 1.52}, {'end': 9476.045, 'text': "In the price, I'm going to write 2000, for example.", 'start': 9471.963, 'duration': 4.082}, {'end': 9481.306, 'text': "And the date, basically, I'm going to set this to current date.", 'start': 9476.065, 'duration': 5.241}, {'end': 9487.889, 'text': "Okay Let's add second, for example, Galaxy S20.", 'start': 9481.747, 'duration': 6.142}, {'end': 9492.93, 'text': "I'm going to leave description and image empty.", 'start': 9488.189, 'duration': 4.741}, {'end': 9494.751, 'text': 'The price basically will be..', 'start': 9492.99, 'duration': 1.761}, {'end': 9501.612, 'text': "click following and let's choose the current date and let's just save this.", 'start': 9495.691, 'duration': 5.921}, {'end': 9506.294, 'text': 'so if we go in the browse, we see these two records in the database.', 'start': 9501.612, 'duration': 4.682}, {'end': 9511.295, 'text': "okay, perfect, now let's start implementing our crud application.", 'start': 9506.294, 'duration': 5.001}, {'end': 9520.497, 'text': "so i'm going to open right here that 14 product crud and let's open our php storm.", 'start': 9511.295, 'duration': 9.202}, {'end': 9525.579, 'text': "i'm going to open this on the full screen as well and start so right here.", 'start': 9520.497, 'duration': 5.082}, {'end': 9532.644, 'text': 'this is the index.php, and whenever we open that index.php, we would like to see the product list.', 'start': 9525.579, 'duration': 7.065}, {'end': 9535.886, 'text': 'okay, including image, title and price.', 'start': 9532.644, 'duration': 3.242}, {'end': 9541.329, 'text': "the description might be very large, so let's don't display the description in the list.", 'start': 9535.886, 'duration': 5.443}, {'end': 9545.752, 'text': "so i'm going to right now use bootstrap for user interface.", 'start': 9541.329, 'duration': 4.423}, {'end': 9557.608, 'text': "okay, so let's open getbootstrap.com, go to the documentation, scroll down and i'm going to choose that starter template,", 'start': 9545.752, 'duration': 11.856}, {'end': 9561.79, 'text': 'copy this one and paste in the index.php.', 'start': 9557.608, 'duration': 4.182}, {'end': 9566.993, 'text': "okay, so we don't actually need which version is this, by the way?", 'start': 9561.79, 'duration': 5.203}, {'end': 9571.428, 'text': 'so yeah, this this looks good.', 'start': 9569.307, 'duration': 2.121}, {'end': 9573.269, 'text': "so yeah, we don't need javascript.", 'start': 9571.428, 'duration': 1.841}, {'end': 9575.05, 'text': "actually, we're not going to use that.", 'start': 9573.269, 'duration': 1.781}, {'end': 9578.292, 'text': "so i'm going to remove all script tags from here.", 'start': 9575.05, 'duration': 3.242}, {'end': 9586.956, 'text': "we will need css to make it a little bit nicer, and i'm going to change the title into products crud.", 'start': 9578.292, 'duration': 8.664}, {'end': 9591.138, 'text': 'okay, now we need to display table right here.', 'start': 9587.356, 'duration': 3.782}, {'end': 9596.201, 'text': "okay, so i'm going to choose a table design also from here.", 'start': 9591.138, 'duration': 5.063}, {'end': 9600.444, 'text': "scroll down and i'm going to pick the very first one and paste right here.", 'start': 9596.201, 'duration': 4.243}, {'end': 9606.428, 'text': "let's format the code and let's open this index.php in the browser and have a look.", 'start': 9600.444, 'duration': 5.984}, {'end': 9609.09, 'text': 'so this is how it looks like.', 'start': 9607.228, 'duration': 1.862}, {'end': 9613.513, 'text': "obviously we don't have the bootstrap css included properly.", 'start': 9609.09, 'duration': 4.423}, {'end': 9618.777, 'text': "okay, let's inspect and see what's going on.", 'start': 9613.513, 'duration': 5.264}, {'end': 9621.64, 'text': 'refresh that.', 'start': 9618.777, 'duration': 2.863}, {'end': 9624.482, 'text': 'okay, something is wrong.', 'start': 9621.64, 'duration': 2.842}, {'end': 9636.192, 'text': "so let's css is not included, refuse to apply styles because the mime type application xml is not supported.", 'start': 9624.482, 'duration': 11.71}, {'end': 9639.623, 'text': 'style sheet, very strange.', 'start': 9636.192, 'duration': 3.431}, {'end': 9642.825, 'text': "let's open this in a new tab.", 'start': 9639.623, 'duration': 3.202}, {'end': 9650.77, 'text': 'okay, i think bootstrap has some bugs at the moment.', 'start': 9642.825, 'duration': 7.945}, {'end': 9662.056, 'text': "okay, so let's search for or let's just download the css, but let's search for cdn, bootstrap, cdn.", 'start': 9650.77, 'duration': 11.286}, {'end': 9663.437, 'text': 'that should actually work.', 'start': 9662.056, 'duration': 1.381}, {'end': 9676.258, 'text': "So right here, let's pick the following link and paste this right here", 'start': 9666.059, 'duration': 10.199}, {'end': 9682.215, 'text': "Okay, let's refresh it.", 'start': 9676.278, 'duration': 5.937}, {'end': 9683.656, 'text': 'and here we have it.', 'start': 9682.215, 'duration': 1.441}, {'end': 9690.46, 'text': "so something was wrong with that link which we just grabbed from the bootstrap's official documentation.", 'start': 9683.656, 'duration': 6.804}, {'end': 9693.662, 'text': "i don't know why, to be honest, but yeah, we have the result.", 'start': 9690.46, 'duration': 3.202}, {'end': 9695.363, 'text': 'so this is the product squad.', 'start': 9693.662, 'duration': 1.701}, {'end': 9708.715, 'text': "so i'm going to also create app css right here and put there just a little bit of padding on the body, padding 50 pixel.", 'start': 9695.363, 'duration': 13.352}, {'end': 9722.23, 'text': "let's save it and i'm going to include that right here link to be up css.", 'start': 9708.715, 'duration': 13.515}, {'end': 9725.013, 'text': 'cool. so we have that little bit of padding.', 'start': 9722.23, 'duration': 2.783}, {'end': 9725.973, 'text': 'okay, perfect.', 'start': 9725.013, 'duration': 0.96}, {'end': 9734.34, 'text': 'now what we need to do is to make a query in the database right here, select that products and display in the table,', 'start': 9725.973, 'duration': 8.367}, {'end': 9737.803, 'text': 'and of course we have to adjust the columns which are displayed right here.', 'start': 9734.34, 'duration': 3.463}, {'end': 9744.99, 'text': "okay, so let's first make a connection to the database and select that products.", 'start': 9738.283, 'duration': 6.707}, {'end': 9748.213, 'text': 'okay, and just dump and to have a look okay.', 'start': 9744.99, 'duration': 3.223}, {'end': 9756.642, 'text': 'so again, i want to highlight that we are right now building a version which a very beginner would build.', 'start': 9748.213, 'duration': 8.429}, {'end': 9762.185, 'text': 'okay, so we have to go with the easiest possible ways, and this is possible.', 'start': 9757.122, 'duration': 5.063}], 'summary': "Created mysql database 'products_crud', added 'products' table with 6 columns, and implemented basic ui using bootstrap.", 'duration': 468.686, 'max_score': 9293.499, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/2eebptXfEvw/pics/2eebptXfEvw9293499.jpg'}, {'end': 10693.267, 'src': 'heatmap', 'start': 9982.781, 'weight': 0.817, 'content': [{'end': 9995.071, 'text': 'so this prepare method finally returns a statement okay, which is an instance of pdo statement, and on that statement we can actually call execute,', 'start': 9982.781, 'duration': 12.29}, {'end': 9997.693, 'text': 'which will make that qr in the database.', 'start': 9995.071, 'duration': 2.622}, {'end': 10006.32, 'text': 'and then on that statement we can call fetch all method and we have to specify right here how i would like to fetch that.', 'start': 9997.693, 'duration': 8.627}, {'end': 10017.444, 'text': "okay, and i'm going to specify fetch assaults, which means that i want each record inside the table to be fetched as an associative array.", 'start': 10006.9, 'duration': 10.544}, {'end': 10027.288, 'text': "okay, and let's save that in a variable of products, and i'm going to dump this right here, that products array, and let's have a look in the browser.", 'start': 10017.444, 'duration': 9.844}, {'end': 10028.789, 'text': 'So here we have it.', 'start': 10027.908, 'duration': 0.881}, {'end': 10031.07, 'text': 'So we have an array of two elements.', 'start': 10029.229, 'duration': 1.841}, {'end': 10034.973, 'text': 'Okay And we have two records in the database as well.', 'start': 10031.631, 'duration': 3.342}, {'end': 10041.557, 'text': 'And each of the element is an associative array of the column name and the value.', 'start': 10035.533, 'duration': 6.024}, {'end': 10050.063, 'text': 'So ID is one, title is iPhone 11, description and image are null, price is this, create date is this, and here is for the second one.', 'start': 10041.958, 'duration': 8.105}, {'end': 10056.447, 'text': 'Okay Now we just need to iterate over each element and just display them in the table.', 'start': 10050.603, 'duration': 5.844}, {'end': 10064.835, 'text': "Okay, so let's remove this var dump, scroll down where we have the table and first let's adjust the columns.", 'start': 10056.807, 'duration': 8.028}, {'end': 10072.163, 'text': "so let's put image first and put, then title, then put.", 'start': 10064.835, 'duration': 7.328}, {'end': 10075.224, 'text': "we don't need description, so let's just put price.", 'start': 10072.163, 'duration': 3.061}, {'end': 10084.069, 'text': "let's put right here, create date as well and put their actions column where we're going to put edit and delete buttons.", 'start': 10075.224, 'duration': 8.845}, {'end': 10087.691, 'text': 'okay. so we have totally six columns.', 'start': 10084.069, 'duration': 3.622}, {'end': 10091.713, 'text': 'in the first column we display just the index of that product.', 'start': 10087.691, 'duration': 4.022}, {'end': 10098.157, 'text': 'okay, now we need to iterate the products we just selected right here and display them properly.', 'start': 10091.713, 'duration': 6.444}, {'end': 10107.627, 'text': 'okay, right here, where we have these tr elements, three tr elements, which is copied and pasted from bootstrap.', 'start': 10098.837, 'duration': 8.79}, {'end': 10112.673, 'text': "let's just leave one, and we need to put that tr in the foreach.", 'start': 10107.627, 'duration': 5.046}, {'end': 10119.878, 'text': "okay. so let's just cut this and write php for each.", 'start': 10112.673, 'duration': 7.205}, {'end': 10123.681, 'text': 'okay, so we have to specify products.', 'start': 10119.878, 'duration': 3.803}, {'end': 10130.985, 'text': "i want to iterate over products and i'm going to call each individual product name of product.", 'start': 10123.681, 'duration': 7.304}, {'end': 10135.428, 'text': "and right here we're going to output the tr which i just copied.", 'start': 10130.985, 'duration': 4.443}, {'end': 10139.831, 'text': "but i'm going to, right here, close the php tag.", 'start': 10135.428, 'duration': 4.403}, {'end': 10143.594, 'text': "okay, right here, and i'm going to start new tag.", 'start': 10139.831, 'duration': 3.763}, {'end': 10147.435, 'text': 'oops, right here, okay.', 'start': 10144.554, 'duration': 2.881}, {'end': 10154.558, 'text': 'so in between these, for each start and for each end, i can write an html.', 'start': 10147.435, 'duration': 7.123}, {'end': 10161.5, 'text': 'okay, if i just save this and refresh in the browser we see two records, the same ones.', 'start': 10154.558, 'duration': 6.942}, {'end': 10163.881, 'text': 'so that happens because we have two products.', 'start': 10161.5, 'duration': 2.381}, {'end': 10168.023, 'text': 'the for each loop iterates two times and it displays the same tr.', 'start': 10163.881, 'duration': 4.142}, {'end': 10175.166, 'text': "okay, i'm going to show you also, second way, how you can write for each, which is generally, uh, what i prefer.", 'start': 10168.883, 'duration': 6.283}, {'end': 10184.912, 'text': "and i generally write like this okay, so we put colon right here, okay, and down below i'm gonna write end for each.", 'start': 10175.166, 'duration': 9.746}, {'end': 10194.617, 'text': 'so this is generally how i write inside html files the for each, okay, but you can choose the previous one, the this one, if you prefer, okay,', 'start': 10184.912, 'duration': 9.705}, {'end': 10196.138, 'text': 'So perfect.', 'start': 10195.337, 'duration': 0.801}, {'end': 10199.162, 'text': 'Now we need to display index right here.', 'start': 10196.699, 'duration': 2.463}, {'end': 10202.506, 'text': "So let's take out the index of this for each loop.", 'start': 10199.543, 'duration': 2.963}, {'end': 10208.634, 'text': "So I'm going to call right here I and the I basically is an index and the product is the product.", 'start': 10202.927, 'duration': 5.707}, {'end': 10222.22, 'text': "and right here we just output i plus one, because the iteration starts with zero and we don't want zero to be displayed in the first column,", 'start': 10210.313, 'duration': 11.907}, {'end': 10224.601, 'text': 'we want it to start with one.', 'start': 10222.22, 'duration': 2.381}, {'end': 10228.503, 'text': 'okay, in the second column we display the title.', 'start': 10224.601, 'duration': 3.902}, {'end': 10236.008, 'text': 'okay, so the product, each product, is an associative array, so we just access the title of that product.', 'start': 10228.503, 'duration': 7.505}, {'end': 10240.01, 'text': "So I'm going to delete these two lines and just duplicate these few times.", 'start': 10236.768, 'duration': 3.242}, {'end': 10245.614, 'text': 'We need right here, excuse me, the first we need image and then title.', 'start': 10240.651, 'duration': 4.963}, {'end': 10249.316, 'text': 'So we have not actually implemented image yet.', 'start': 10246.154, 'duration': 3.162}, {'end': 10251.958, 'text': "So I'm going to leave this td empty.", 'start': 10249.376, 'duration': 2.582}, {'end': 10257.083, 'text': 'then we display title, then we display price,', 'start': 10252.939, 'duration': 4.144}, {'end': 10267.595, 'text': 'then we display create underscore date and right here we should display two buttons one for edit and second for delete.', 'start': 10257.083, 'duration': 10.512}, {'end': 10276.686, 'text': "okay, so let's go to the bootstrap documentation for buttons, and right here we can choose the buttons we prefer.", 'start': 10267.595, 'duration': 9.091}, {'end': 10279.868, 'text': "i'm going to go with outline buttons, the following ones.", 'start': 10276.686, 'duration': 3.182}, {'end': 10284.01, 'text': "so i'm going to copy the very first one and paste right here,", 'start': 10279.868, 'duration': 4.142}, {'end': 10295.817, 'text': "and i'm going to call this edit and i'm going to just duplicate this and change the primary into danger and call this delete.", 'start': 10284.01, 'duration': 11.807}, {'end': 10301.181, 'text': "okay, so let's just save this and have a look in the browser.", 'start': 10295.817, 'duration': 5.364}, {'end': 10304.542, 'text': 'refresh, and here we see the products.', 'start': 10301.841, 'duration': 2.701}, {'end': 10309.684, 'text': 'okay, the image is empty, index and title, and everything is displayed properly.', 'start': 10304.542, 'duration': 5.142}, {'end': 10312.525, 'text': "i'm going to change the button size into smaller ones.", 'start': 10309.684, 'duration': 2.841}, {'end': 10314.666, 'text': "i don't want that large buttons.", 'start': 10312.525, 'duration': 2.141}, {'end': 10318.647, 'text': 'btn, sm, save refresh, perfect.', 'start': 10314.666, 'duration': 3.981}, {'end': 10327.071, 'text': "okay, let's go ahead and add one more product and i'm going to call this iphone se.", 'start': 10318.647, 'duration': 8.424}, {'end': 10338.442, 'text': "probably. let's give it a price, okay, and let's give it date as well and click the go, and it was inserted.", 'start': 10327.071, 'duration': 11.371}, {'end': 10346.291, 'text': 'refresh it, and here we see that se as a very first one, because we are just sorting this in a descending order.', 'start': 10338.442, 'duration': 7.849}, {'end': 10353.986, 'text': "now let's implement creating a form, create form of the product.", 'start': 10348.038, 'duration': 5.948}, {'end': 10359.534, 'text': "so first let's add create button right here above the table.", 'start': 10353.986, 'duration': 5.548}, {'end': 10362.318, 'text': "so i'm going to create a paragraph inside the paragraph.", 'start': 10359.534, 'duration': 2.784}, {'end': 10367.782, 'text': "i'm going to create a button which will have a class of btn, btn, success.", 'start': 10362.318, 'duration': 5.464}, {'end': 10372.785, 'text': "these are just bootstrap classes and i'm going to call this create.", 'start': 10367.782, 'duration': 5.003}, {'end': 10374.866, 'text': 'so have a look here we have.', 'start': 10372.785, 'duration': 2.081}, {'end': 10377.287, 'text': "so let's just call it create product.", 'start': 10374.866, 'duration': 2.421}, {'end': 10381.109, 'text': 'and we have to also change this into an anchor link instead of a button,', 'start': 10377.287, 'duration': 3.822}, {'end': 10386.571, 'text': "because we're going to add href right there and i'm going to put right here create.php.", 'start': 10381.109, 'duration': 5.462}, {'end': 10392.916, 'text': 'okay, so whenever we click on that link, it should open create.php.', 'start': 10388.052, 'duration': 4.864}, {'end': 10399.361, 'text': "so if i click right now, it tells me not found because that create.php doesn't exist.", 'start': 10392.916, 'duration': 6.445}, {'end': 10401.863, 'text': "so let's just create that.", 'start': 10399.361, 'duration': 2.502}, {'end': 10406.306, 'text': 'so right here we need that create.php.', 'start': 10401.863, 'duration': 4.443}, {'end': 10413.092, 'text': 'okay, inside that create.php we have to include that bootstrap and everything.', 'start': 10406.306, 'duration': 6.786}, {'end': 10416.915, 'text': 'basically, regarding styling what we have in index.php.', 'start': 10413.092, 'duration': 3.823}, {'end': 10426.322, 'text': 'okay, so we are doing this as a beginner and the main thing for us is to achieve the final goal and have it working.', 'start': 10417.375, 'duration': 8.947}, {'end': 10434.189, 'text': "so and let's just copy everything in from index into create okay and adjust couple of things.", 'start': 10426.322, 'duration': 7.867}, {'end': 10438.553, 'text': 'so we will need connection to the database.', 'start': 10434.189, 'duration': 4.364}, {'end': 10440.814, 'text': "so, but we don't need to select the product.", 'start': 10438.553, 'duration': 2.261}, {'end': 10442.356, 'text': "so i'm going to remove that select.", 'start': 10440.814, 'duration': 1.542}, {'end': 10450.24, 'text': 'we will need that stylings in bootstrap and upcss and that should.', 'start': 10443.196, 'duration': 7.044}, {'end': 10455.023, 'text': 'the title should be basically create new product.', 'start': 10450.24, 'duration': 4.783}, {'end': 10457.985, 'text': "okay, let's just do like this.", 'start': 10455.023, 'duration': 2.962}, {'end': 10462.047, 'text': 'and we need, instead of a table right here, we need a form.', 'start': 10457.985, 'duration': 4.062}, {'end': 10467.611, 'text': "okay, so let's open bootstrap documentation and search for form.", 'start': 10462.047, 'duration': 5.564}, {'end': 10469.332, 'text': 'okay, scroll down.', 'start': 10468.351, 'duration': 0.981}, {'end': 10471.394, 'text': 'this is the very basic example of the form.', 'start': 10469.332, 'duration': 2.062}, {'end': 10477.338, 'text': "i'm going to copy this and paste right here, format the code and have a look in the browser.", 'start': 10471.394, 'duration': 5.944}, {'end': 10482.062, 'text': 'so here we have that create new product, but we need to adjust that form.', 'start': 10477.338, 'duration': 4.724}, {'end': 10483.343, 'text': 'elements right.', 'start': 10482.062, 'duration': 1.281}, {'end': 10489.028, 'text': "so i'm going to remove that for and id and make this as simple as possible.", 'start': 10483.343, 'duration': 5.685}, {'end': 10490.809, 'text': "so we don't want id.", 'start': 10489.028, 'duration': 1.781}, {'end': 10492.03, 'text': "i'm going to remove that.", 'start': 10490.809, 'duration': 1.221}, {'end': 10496.794, 'text': "oops, i'm going to remove that aria described by.", 'start': 10492.03, 'duration': 4.764}, {'end': 10498.015, 'text': 'so this thing.', 'start': 10496.794, 'duration': 1.221}, {'end': 10502.578, 'text': "so i'm going to remove that id, or we just don't need that small at all.", 'start': 10498.015, 'duration': 4.563}, {'end': 10503.959, 'text': 'so this is going to be email.', 'start': 10502.578, 'duration': 1.381}, {'end': 10507.302, 'text': 'no, this is going to be a product, a title.', 'start': 10503.959, 'duration': 3.343}, {'end': 10514.244, 'text': 'okay, and this should be input type text and we need to give it a name as well.', 'start': 10508.022, 'duration': 6.222}, {'end': 10517.985, 'text': "but i'm going to leave this without names to show you one important thing.", 'start': 10514.244, 'duration': 3.741}, {'end': 10526.027, 'text': "so then i'm going to just delete everything and copy and paste this okay, few more times.", 'start': 10517.985, 'duration': 8.042}, {'end': 10529.988, 'text': 'so one will be for title, second will be for.', 'start': 10526.027, 'duration': 3.961}, {'end': 10535.03, 'text': 'uh, actually, the first one should be product image, which will be input type file.', 'start': 10529.988, 'duration': 5.042}, {'end': 10538.112, 'text': "then we're gonna have title.", 'start': 10535.73, 'duration': 2.382}, {'end': 10543.276, 'text': "then we're gonna have description, which should be text area.", 'start': 10538.112, 'duration': 5.164}, {'end': 10545.238, 'text': 'it should not be input.', 'start': 10543.276, 'duration': 1.962}, {'end': 10549.161, 'text': "okay then, and the text area doesn't need that type.", 'start': 10545.238, 'duration': 3.923}, {'end': 10553.044, 'text': "then we're gonna have product price, and that is basically all.", 'start': 10549.161, 'duration': 3.883}, {'end': 10567.338, 'text': "the product price should be number, And I'm going to give it also step 0.01, so that the price of the product can include decimal numbers as well,", 'start': 10553.044, 'duration': 14.294}, {'end': 10568.88, 'text': 'like 5.25 or something like this.', 'start': 10567.338, 'duration': 1.542}, {'end': 10572.684, 'text': "okay, so let's have a look in the browser.", 'start': 10570.581, 'duration': 2.103}, {'end': 10579.653, 'text': "so this is the product image and let's just remove the form control on the input type file.", 'start': 10572.684, 'duration': 6.969}, {'end': 10582.136, 'text': "we don't need that refresh.", 'start': 10579.653, 'duration': 2.483}, {'end': 10585.26, 'text': 'so, and we put br right here.', 'start': 10582.136, 'duration': 3.124}, {'end': 10586.541, 'text': "so that's good enough.", 'start': 10585.26, 'duration': 1.281}, {'end': 10587.402, 'text': 'so we have that.', 'start': 10586.541, 'duration': 0.861}, {'end': 10592.666, 'text': 'we have product title, description, price, and that is basically all okay.', 'start': 10587.402, 'duration': 5.264}, {'end': 10601.15, 'text': 'so whenever we hit the submit, we want to get that submitted information and create a product in the database in the mysql.', 'start': 10592.666, 'duration': 8.484}, {'end': 10603.031, 'text': 'okay, how to do that?', 'start': 10601.15, 'duration': 1.881}, {'end': 10608.693, 'text': 'so right now, if i click the submit, it actually submits the form, but nothing happens.', 'start': 10603.031, 'duration': 5.662}, {'end': 10613.935, 'text': 'okay, in the form we have to specify two attributes.', 'start': 10608.693, 'duration': 5.242}, {'end': 10622.46, 'text': "so the action defines where the form needs to be submitted, and in our case we're going to submit on the same file.", 'start': 10613.935, 'duration': 8.525}, {'end': 10627.644, 'text': 'so the create.php should be where the data should be sent.', 'start': 10622.46, 'duration': 5.184}, {'end': 10634.109, 'text': 'okay, if we want the same file to be used for submitting, we can even put this and leave it empty.', 'start': 10627.644, 'duration': 6.465}, {'end': 10637.071, 'text': 'okay. and the second attribute is method.', 'start': 10634.109, 'duration': 2.962}, {'end': 10646.836, 'text': 'Generally, when we create or update or delete something in the database, we should do this using method POST.', 'start': 10638.072, 'duration': 8.764}, {'end': 10648.337, 'text': 'It is much more secure.', 'start': 10647.096, 'duration': 1.241}, {'end': 10651.038, 'text': "And I'm going to show you the difference between GET and POST.", 'start': 10648.517, 'duration': 2.521}, {'end': 10653.599, 'text': "First, let's leave it GET.", 'start': 10652.419, 'duration': 1.18}, {'end': 10658.402, 'text': "And by default, if you just don't provide the method attribute, it is GET.", 'start': 10653.8, 'duration': 4.602}, {'end': 10664.243, 'text': "so let's leave it get and just hit the submit and nothing basically happens.", 'start': 10659.222, 'duration': 5.021}, {'end': 10674.626, 'text': 'so that because the input fields does not have names, whenever we submit that, the form takes the names of the input fields,', 'start': 10664.243, 'duration': 10.383}, {'end': 10677.366, 'text': "and that's why we have to specify right here names.", 'start': 10674.626, 'duration': 2.74}, {'end': 10688.389, 'text': "and that's going to be image, this will be title, this will be description and this will be price.", 'start': 10677.366, 'duration': 11.023}, {'end': 10693.267, 'text': 'save it, refresh.', 'start': 10691.565, 'duration': 1.702}], 'summary': 'The transcript covers php code for querying, displaying, and creating products from a database, including implementing a form for adding new products.', 'duration': 710.486, 'max_score': 9982.781, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/2eebptXfEvw/pics/2eebptXfEvw9982781.jpg'}, {'end': 10072.163, 'src': 'embed', 'start': 10017.444, 'weight': 1, 'content': [{'end': 10027.288, 'text': "okay, and let's save that in a variable of products, and i'm going to dump this right here, that products array, and let's have a look in the browser.", 'start': 10017.444, 'duration': 9.844}, {'end': 10028.789, 'text': 'So here we have it.', 'start': 10027.908, 'duration': 0.881}, {'end': 10031.07, 'text': 'So we have an array of two elements.', 'start': 10029.229, 'duration': 1.841}, {'end': 10034.973, 'text': 'Okay And we have two records in the database as well.', 'start': 10031.631, 'duration': 3.342}, {'end': 10041.557, 'text': 'And each of the element is an associative array of the column name and the value.', 'start': 10035.533, 'duration': 6.024}, {'end': 10050.063, 'text': 'So ID is one, title is iPhone 11, description and image are null, price is this, create date is this, and here is for the second one.', 'start': 10041.958, 'duration': 8.105}, {'end': 10056.447, 'text': 'Okay Now we just need to iterate over each element and just display them in the table.', 'start': 10050.603, 'duration': 5.844}, {'end': 10064.835, 'text': "Okay, so let's remove this var dump, scroll down where we have the table and first let's adjust the columns.", 'start': 10056.807, 'duration': 8.028}, {'end': 10072.163, 'text': "so let's put image first and put, then title, then put.", 'start': 10064.835, 'duration': 7.328}], 'summary': 'Demonstration of products array with two elements and database containing two records.', 'duration': 54.719, 'max_score': 10017.444, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/2eebptXfEvw/pics/2eebptXfEvw10017444.jpg'}, {'end': 10194.617, 'src': 'embed', 'start': 10161.5, 'weight': 2, 'content': [{'end': 10163.881, 'text': 'so that happens because we have two products.', 'start': 10161.5, 'duration': 2.381}, {'end': 10168.023, 'text': 'the for each loop iterates two times and it displays the same tr.', 'start': 10163.881, 'duration': 4.142}, {'end': 10175.166, 'text': "okay, i'm going to show you also, second way, how you can write for each, which is generally, uh, what i prefer.", 'start': 10168.883, 'duration': 6.283}, {'end': 10184.912, 'text': "and i generally write like this okay, so we put colon right here, okay, and down below i'm gonna write end for each.", 'start': 10175.166, 'duration': 9.746}, {'end': 10194.617, 'text': 'so this is generally how i write inside html files the for each, okay, but you can choose the previous one, the this one, if you prefer, okay,', 'start': 10184.912, 'duration': 9.705}], 'summary': 'Demonstration of two ways to write a for each loop in html, iterating two times', 'duration': 33.117, 'max_score': 10161.5, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/2eebptXfEvw/pics/2eebptXfEvw10161500.jpg'}, {'end': 10359.534, 'src': 'embed', 'start': 10327.071, 'weight': 3, 'content': [{'end': 10338.442, 'text': "probably. let's give it a price, okay, and let's give it date as well and click the go, and it was inserted.", 'start': 10327.071, 'duration': 11.371}, {'end': 10346.291, 'text': 'refresh it, and here we see that se as a very first one, because we are just sorting this in a descending order.', 'start': 10338.442, 'duration': 7.849}, {'end': 10353.986, 'text': "now let's implement creating a form, create form of the product.", 'start': 10348.038, 'duration': 5.948}, {'end': 10359.534, 'text': "so first let's add create button right here above the table.", 'start': 10353.986, 'duration': 5.548}], 'summary': 'Implemented price and date insertion, sorted in descending order, and added create button for product form.', 'duration': 32.463, 'max_score': 10327.071, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/2eebptXfEvw/pics/2eebptXfEvw10327071.jpg'}], 'start': 9006.412, 'title': 'Api, mysql, pdo, and php', 'summary': 'Covers creating users with curl, setting up mysql database and products table, establishing beginner version with pdo for database connection, implementing product form in php, and highlighting data handling with http methods get and post in php, with specific examples and results.', 'chapters': [{'end': 9292.178, 'start': 9006.412, 'title': 'Creating user with curl in api', 'summary': 'Demonstrates making a post request using curl to create a user in an api, specifying the url, post fields, and http header, resulting in the creation of a user with id 11, showcasing the powerful capabilities of curl.', 'duration': 285.766, 'highlights': ['The chapter demonstrates making a POST request using cURL to create a user in an API The speaker explains the process of making a POST request using cURL to create a user in an API.', 'Resulting in the creation of a user with ID 11 The API successfully creates a user, assigning it the ID 11.', 'Specifying the URL, post fields, and HTTP header The speaker specifies the URL, post fields, and HTTP header in the cURL request to ensure the successful creation of the user in the API.', 'Showcasing the powerful capabilities of cURL The speaker highlights the versatility and power of cURL, mentioning its ability to be used for various purposes like uploading files, downloading files, and passing authentication.']}, {'end': 9722.23, 'start': 9293.499, 'title': 'Creating mysql database and products table', 'summary': 'Demonstrates the process of creating a database and a products table in mysql through phpmyadmin, specifying column details and creating records, and implementing a crud application with bootstrap for user interface.', 'duration': 428.731, 'highlights': ["Creating a database and a products table in MySQL through phpMyAdmin The speaker demonstrates the process of creating a database named 'products_crud' and a table named 'products' in MySQL through phpMyAdmin, specifying column details such as id, title, description, image, price, and create date.", "Adding records to the products table The speaker adds two records to the products table, 'iphone 11' with a price of $2000 and 'Galaxy S20', demonstrating the process of inserting records and showing the records in the database.", 'Implementing a CRUD application with Bootstrap for user interface The speaker implements a CRUD application, demonstrating the use of Bootstrap for user interface design and displaying a table for product listing in the index.php file.']}, {'end': 10295.817, 'start': 9722.23, 'title': 'Building a beginner version with pdo for database connection', 'summary': 'Covers building a beginner version with pdo for database connection, emphasizing the advantages of pdo over mysqli, and walking through the process of establishing a connection, making a query in the database, and displaying the products in a table.', 'duration': 573.587, 'highlights': ['Emphasizing the advantages of PDO over mysqli The speaker encourages using PDO for database connection, highlighting its advantages such as being more powerful, supporting multiple databases, and being object-oriented.', 'Establishing a connection to the database using PDO The process of establishing a connection to the database using PDO is explained, including specifying the DSN string, user, and setting error mode to throw an exception in case of connection errors.', 'Making a query in the database and selecting all the products using prepared statements The chapter demonstrates the use of prepared statements to make a query in the database, select all products, and order them by the create date in descending order, returning the results as an associative array.', 'Iterating over the selected products and displaying them in a table The process of iterating over the selected products and displaying them in a table is shown, including adjusting the columns, iterating over the products, and displaying the relevant information in each table row.']}, {'end': 10785.934, 'start': 10295.817, 'title': 'Implementing product form in php', 'summary': 'Covers implementing a product form in php to add and submit product details, including creating a form, handling form submission, and explaining the query string generated upon form submission.', 'duration': 490.117, 'highlights': ['Implemented a product form in PHP to add and submit product details, including creating a form, handling form submission, and explaining the query string generated upon form submission. Implemented product form, handled form submission, explained query string', "Changed the button size to smaller ones using Bootstrap classes ('btn, sm') for better display. Changed button size to smaller ones, used Bootstrap classes", "Added a new product 'iPhone SE' and displayed it as the first one by sorting in descending order. Added 'iPhone SE' as a new product, displayed it as the first one by sorting", "Explained the attributes 'action' and 'method' in form submission, emphasizing the use of POST method for database operations for security purposes. Explained attributes 'action' and 'method', emphasized use of POST method for security"]}, {'end': 11525.57, 'start': 10785.934, 'title': 'Http methods and data handling', 'summary': 'Illustrates how to handle data using get and post methods in php, highlighting the risks of using concatenation for database operations and emphasizing the use of prepared statements for safety and security.', 'duration': 739.636, 'highlights': ['Prepared statements should be used for database operations The transcript emphasizes the importance of using prepared statements for database operations to prevent SQL injection attacks, ensuring safety and security.', 'Dangers of using concatenation for database operations The risks of using concatenation for database operations are emphasized, as it can lead to SQL injection attacks, potentially causing data loss or damage to the database.', 'Distinction between using GET and POST methods for data handling The difference between using GET and POST methods is explained, highlighting that sensitive information like username and password should not be passed using the GET method.']}], 'duration': 2519.158, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/2eebptXfEvw/pics/2eebptXfEvw9006412.jpg', 'highlights': ['The chapter demonstrates making a POST request using cURL to create a user in an API', 'Creating a database and a products table in MySQL through phpMyAdmin', 'Emphasizing the advantages of PDO over mysqli', 'Implemented a product form in PHP to add and submit product details, including creating a form, handling form submission, and explaining the query string generated upon form submission', 'Prepared statements should be used for database operations']}, {'end': 12681.997, 'segs': [{'end': 11552.834, 'src': 'embed', 'start': 11525.57, 'weight': 6, 'content': [{'end': 11532.254, 'text': "so let's search for method and here we have request method and this indicates that the method is get.", 'start': 11525.57, 'duration': 6.684}, {'end': 11544.906, 'text': "so if i just remove exit right here and refresh, so the method is get, we don't see anything right here simply because we have some fatal errors.", 'start': 11533.454, 'duration': 11.452}, {'end': 11549.831, 'text': 'okay, but if we submit that form, the request method will be post.', 'start': 11544.906, 'duration': 4.925}, {'end': 11552.834, 'text': 'okay. so we need to do something like this.', 'start': 11549.831, 'duration': 3.003}], 'summary': "The method 'get' is indicated in the request; submitting the form will change the method to 'post'.", 'duration': 27.264, 'max_score': 11525.57, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/2eebptXfEvw/pics/2eebptXfEvw11525570.jpg'}, {'end': 11635.994, 'src': 'embed', 'start': 11610.097, 'weight': 9, 'content': [{'end': 11621.547, 'text': 'hit the enter and here we see that now request method is post and in the database we should also see one more record and here we have title description and the price.', 'start': 11610.097, 'duration': 11.45}, {'end': 11624.81, 'text': 'okay, so this works also very well.', 'start': 11621.547, 'duration': 3.263}, {'end': 11633.013, 'text': 'we need to make validations also, so if the title or price is not provided, we have to print the error.', 'start': 11625.43, 'duration': 7.583}, {'end': 11635.194, 'text': 'okay, so how to do that?', 'start': 11633.013, 'duration': 2.181}, {'end': 11635.994, 'text': 'so we need.', 'start': 11635.194, 'duration': 0.8}], 'summary': 'Implemented post request method; added new record with title, description, and price. next step: implement validations for missing title or price.', 'duration': 25.897, 'max_score': 11610.097, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/2eebptXfEvw/pics/2eebptXfEvw11610097.jpg'}, {'end': 11726.562, 'src': 'embed', 'start': 11691.733, 'weight': 0, 'content': [{'end': 11697.46, 'text': "okay. so right here i'm gonna put a bootstrap alert.", 'start': 11691.733, 'duration': 5.727}, {'end': 11705.308, 'text': 'okay, that should be div with alert class alert, danger, okay,', 'start': 11697.46, 'duration': 7.848}, {'end': 11718.677, 'text': "and i'm going to iterate over errors php for each errors as error and i'm going to end for each, use the end for each syntax php end for each,", 'start': 11705.308, 'duration': 13.369}, {'end': 11726.562, 'text': "and i'm going to display right here a div with the error message okay, just like this one.", 'start': 11718.677, 'duration': 7.885}], 'summary': 'Adding a bootstrap alert for displaying php errors.', 'duration': 34.829, 'max_score': 11691.733, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/2eebptXfEvw/pics/2eebptXfEvw11691733.jpg'}, {'end': 11813.235, 'src': 'embed', 'start': 11788.029, 'weight': 10, 'content': [{'end': 11793.571, 'text': 'but I want to show you the problems beginners come across and then how to solve these problems.', 'start': 11788.029, 'duration': 5.542}, {'end': 11803.853, 'text': 'Okay, so just I knew when I wrote errors right here that there would be an error down below, but I just want to make mistakes and then fix them.', 'start': 11793.991, 'duration': 9.862}, {'end': 11809.654, 'text': "okay, so we have errors right here and let's just remove this request method.", 'start': 11804.273, 'duration': 5.381}, {'end': 11813.235, 'text': "we don't need we understood how to print the request method.", 'start': 11809.654, 'duration': 3.581}], 'summary': 'Beginners encounter problems and learn to fix errors in coding.', 'duration': 25.206, 'max_score': 11788.029, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/2eebptXfEvw/pics/2eebptXfEvw11788029.jpg'}, {'end': 12086.083, 'src': 'heatmap', 'start': 11853.402, 'weight': 0.704, 'content': [{'end': 11856.504, 'text': 'okay, save refresh and looks good.', 'start': 11853.402, 'duration': 3.102}, {'end': 11859.987, 'text': "okay, when we open the form we don't see anything extra.", 'start': 11856.504, 'duration': 3.483}, {'end': 11866.391, 'text': 'now, if i hit the submit button, i see both of the errors product title is required,', 'start': 11859.987, 'duration': 6.404}, {'end': 11877.548, 'text': 'product price is required and But still the record is made in the database because we have not actually written the corresponding code.', 'start': 11866.391, 'duration': 11.157}, {'end': 11889.199, 'text': 'So when we set errors right here, we need to check if errors is empty only in this case, make an insert in the database.', 'start': 11878.469, 'duration': 10.73}, {'end': 11894.204, 'text': "So if errors is empty, let's just use the empty function.", 'start': 11889.679, 'duration': 4.525}, {'end': 11897.706, 'text': 'only in this case, make an insert in the database.', 'start': 11895.164, 'duration': 2.542}, {'end': 11905.91, 'text': "and now, if i just hit the submit button and have a look in the database, it doesn't make inserts in the database.", 'start': 11897.706, 'duration': 8.204}, {'end': 11916.676, 'text': 'okay, perfect, if i provide something in the title, okay, test product and hit the submit button, i see one error only about product price.', 'start': 11905.91, 'duration': 10.766}, {'end': 11924.381, 'text': 'okay, and it also does not make recording the database, which is very good, which is exactly what we want, okay.', 'start': 11917.176, 'duration': 7.205}, {'end': 11933.246, 'text': 'so if i provide both like the product title and product price, it will make an insert in the database.', 'start': 11924.381, 'duration': 8.865}, {'end': 11934.827, 'text': 'but one important thing as well.', 'start': 11933.246, 'duration': 1.581}, {'end': 11943.553, 'text': "so if i just don't provide the product price and hit the submit, the product title which i entered right here simply disappears.", 'start': 11934.827, 'duration': 8.726}, {'end': 11948.038, 'text': 'okay. so we need management for that as well.', 'start': 11944.033, 'duration': 4.005}, {'end': 11951.662, 'text': 'okay, so we just want the title to be displayed right here.', 'start': 11948.038, 'duration': 3.624}, {'end': 11953.343, 'text': 'so how to do that?', 'start': 11951.662, 'duration': 1.681}, {'end': 11957.548, 'text': 'so we have title, description and price variables right here.', 'start': 11953.343, 'duration': 4.205}, {'end': 11965.073, 'text': 'so if we can just use them right down below when we render the form and assign the value back.', 'start': 11957.548, 'duration': 7.525}, {'end': 11970.076, 'text': 'So if I just write value equals PHP echo title.', 'start': 11965.433, 'duration': 4.643}, {'end': 11978.88, 'text': "So let's just write title back inside that product title, OK? So if I refresh this right here, I see that product title is displayed.", 'start': 11970.536, 'duration': 8.344}, {'end': 11982.623, 'text': 'But this code has some error.', 'start': 11979.54, 'duration': 3.083}, {'end': 11987.448, 'text': 'So it is not a very good solution doing just like this.', 'start': 11983.104, 'duration': 4.344}, {'end': 11996.877, 'text': "And I'm going to pause right here for several seconds, think about it, what problem this might have, and then see my solution.", 'start': 11988.169, 'duration': 8.708}, {'end': 12010.223, 'text': 'okay, the problem is that if i just open that form using method get, i see that error undefined variable title, because again,', 'start': 12000.655, 'duration': 9.568}, {'end': 12019.75, 'text': 'the title is described inside that if statement and we are accessing right here when it is not actually described yet.', 'start': 12010.223, 'duration': 9.527}, {'end': 12025.055, 'text': "so what do we need to do is that let's create a variable title with an empty string right here.", 'start': 12019.75, 'duration': 5.305}, {'end': 12027.756, 'text': 'okay, and that should fix the problem.', 'start': 12025.515, 'duration': 2.241}, {'end': 12035.099, 'text': "okay, we don't see this anymore, and let's do the same thing for price as an empty string and for description.", 'start': 12027.756, 'duration': 7.343}, {'end': 12041.141, 'text': "okay, now, let's just use that price and description down below as well.", 'start': 12035.099, 'duration': 6.042}, {'end': 12051.299, 'text': "so inside the text area we're gonna display description and down below, inside the price, we are going to display the price.", 'start': 12041.141, 'duration': 10.158}, {'end': 12056.423, 'text': "okay, now, if i provide price but don't provide the title, hit the submit button.", 'start': 12051.299, 'duration': 5.124}, {'end': 12064.108, 'text': 'i still see that price is provided, and if i just provide also some description and hit the submit button, both of them stays there.', 'start': 12056.423, 'duration': 7.685}, {'end': 12066.009, 'text': 'it only complains about the title.', 'start': 12064.108, 'duration': 1.901}, {'end': 12070.212, 'text': 'okay, so the validations are also done, which is very good.', 'start': 12066.009, 'duration': 4.203}, {'end': 12086.083, 'text': "now what we need to do is to upload the file pictures php, course, and i'm going to choose right here that image and hit that submit button,", 'start': 12070.212, 'duration': 15.871}], 'summary': 'Form validation ensures errors are displayed and database inserts are controlled based on input', 'duration': 232.681, 'max_score': 11853.402, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/2eebptXfEvw/pics/2eebptXfEvw11853402.jpg'}, {'end': 12315.91, 'src': 'embed', 'start': 12287.012, 'weight': 1, 'content': [{'end': 12294.737, 'text': "But if that image is not presented in the superglobal files, let's just take the image to be null.", 'start': 12287.012, 'duration': 7.725}, {'end': 12300.86, 'text': 'Then we need to check if the image is not null, if the image exists.', 'start': 12295.477, 'duration': 5.383}, {'end': 12304.122, 'text': 'So we have to save that image somewhere.', 'start': 12301.541, 'duration': 2.581}, {'end': 12308.385, 'text': "So for this, I'm going to use moveUploadedFile function.", 'start': 12304.602, 'duration': 3.783}, {'end': 12313.648, 'text': 'We have to specify from where we want to move that uploaded file.', 'start': 12309.045, 'duration': 4.603}, {'end': 12315.91, 'text': 'And this is going to be the path.', 'start': 12313.788, 'duration': 2.122}], 'summary': 'If image not in superglobal files, set to null. use moveuploadedfile function to save image.', 'duration': 28.898, 'max_score': 12287.012, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/2eebptXfEvw/pics/2eebptXfEvw12287012.jpg'}], 'start': 11525.57, 'title': 'Php form submission, validation, error handling, and file uploads', 'summary': 'Covers php form submission, validation, error handling, and file uploads, including topics such as checking request method, database data insertion, input field validation, error array creation, conditional checks, form data handling, file uploads, moving uploaded files, managing file storage, and generating unique paths.', 'chapters': [{'end': 11664.666, 'start': 11525.57, 'title': 'Php form submission and validation', 'summary': 'Covers form submission and validation in php, including checking the request method, inserting data into the database, and validating input fields for title and price.', 'duration': 139.096, 'highlights': ["The request method needs to be checked, and if it equals 'post', the title, description, and price should be taken from the post and inserted into the database.", 'Validation for the title and price is necessary, and if either is not provided, an error should be printed.', 'The code demonstrates checking the request method, inserting data into the database, and validating input fields for title and price in a PHP form submission and handling scenario.']}, {'end': 12027.756, 'start': 11664.666, 'title': 'Error handling in form submission', 'summary': 'Discusses error handling in form submission, including creating an errors array to display alerts for missing product title and price, implementing conditional check to prevent record insertion when errors exist, and addressing the issue of disappearing product title upon form submission.', 'duration': 363.09, 'highlights': ["Creating an errors array to display alerts for missing product title and price Demonstrates the creation of an errors array to display alerts for missing product title and price, with specific error messages such as 'Please provide the product title' and 'Product price is required'.", 'Implementing conditional check to prevent record insertion when errors exist Shows the implementation of a conditional check using the empty function to prevent record insertion when errors exist, ensuring that the database is not updated when errors are present.', "Addressing the issue of disappearing product title upon form submission Addresses the issue of the product title disappearing upon form submission by creating a variable 'title' with an empty string to fix the problem of accessing the title variable when it is not yet defined."]}, {'end': 12343.647, 'start': 12027.756, 'title': 'Handling form data and file uploads', 'summary': 'Covers handling form data, file uploads, and moving the uploaded file to a permanent location in php, including the use of superglobal variables, validation of form inputs, and the moveuploadedfile function.', 'duration': 315.891, 'highlights': ["The superglobal variable files contains all the uploaded files, and using 'ink type multi-part form data' in the form attribute specifies that files will be submitted. The superglobal variable files contains all the uploaded files, and adding the attribute 'ink type multi-part form data' in the form specifies that files will be submitted.", 'The moveUploadedFile function is used to move the uploaded file to a permanent location, with an explanation of specifying the original and destination paths. The moveUploadedFile function is used to move the uploaded file to a permanent location, specifying the original and destination paths.', 'Validation of form inputs is performed, ensuring that the title, price, and description are handled appropriately. Validation of form inputs is performed, ensuring that the title, price, and description are handled appropriately.']}, {'end': 12681.997, 'start': 12343.647, 'title': 'Managing uploaded files and unique paths', 'summary': 'Discusses the process of saving uploaded files on the file system, ensuring unique paths for each product to prevent overwriting, and the generation of random folder names for file storage.', 'duration': 338.35, 'highlights': ['The process of saving uploaded files on the file system and ensuring unique paths for each product to prevent overwriting is discussed. The chapter emphasizes the importance of saving uploaded files on the file system and ensuring unique paths for each product to prevent overwriting, highlighting the potential issues of multiple products uploading files with the same name and the need for unique paths to avoid overwriting.', 'The generation of random folder names for file storage is explained, along with the function for generating a random string. The chapter explains the generation of random folder names for file storage and provides a detailed function for generating a random string, outlining the process of iterating through characters to create a random string of a specified length.', 'The potential mistakes made by beginner developers in file uploading processes are highlighted, including using the original file name instead of creating a unique path. The chapter highlights potential mistakes made by beginner developers in file uploading processes, such as using the original file name instead of creating a unique path, emphasizing the importance of ensuring unique paths for each product to avoid overwriting.']}], 'duration': 1156.427, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/2eebptXfEvw/pics/2eebptXfEvw11525570.jpg', 'highlights': ["Insert title, description, and price into database if request method is 'post'", 'Validate title and price, print error if not provided in PHP form submission', 'Create errors array to display alerts for missing product title and price', 'Implement conditional check to prevent record insertion when errors exist', 'Address issue of disappearing product title upon form submission', 'Superglobal variable files contains uploaded files for multi-part form data', 'Use moveUploadedFile function to move uploaded file to permanent location', 'Validate form inputs for title, price, and description handling', 'Emphasize importance of saving uploaded files on file system with unique paths', 'Explain generation of random folder names for file storage and random string function', 'Highlight potential mistakes in file uploading processes by beginner developers']}, {'end': 15257.433, 'segs': [{'end': 13945.493, 'src': 'heatmap', 'start': 12759.047, 'weight': 3, 'content': [{'end': 12765.412, 'text': 'so now down below we have to actually create that random directory.', 'start': 12759.047, 'duration': 6.365}, {'end': 12767.294, 'text': 'so how to do that?', 'start': 12765.412, 'duration': 1.882}, {'end': 12768.995, 'text': 'and we have to also create the image path.', 'start': 12767.294, 'duration': 1.701}, {'end': 12781.94, 'text': "so image path will be so where the actual image should be saved and that's going to be images inside the images folder,", 'start': 12770.655, 'duration': 11.285}, {'end': 12792.525, 'text': "random string for the length of 8, and then we're going to provide the actual uploaded image name.", 'start': 12781.94, 'duration': 10.585}, {'end': 12795.426, 'text': "okay, that's going to be the image path.", 'start': 12792.525, 'duration': 2.901}, {'end': 12799.428, 'text': "and let's just dump the following image path and have a look.", 'start': 12795.426, 'duration': 4.002}, {'end': 12807.113, 'text': "and i'm going to exit right here, save and refresh, and here we see that image path.", 'start': 12800.268, 'duration': 6.845}, {'end': 12813.138, 'text': 'so inside images folder, inside that random directory, this is going to be the image.', 'start': 12807.113, 'duration': 6.025}, {'end': 12819.083, 'text': 'okay, if i refresh this, i see that random directory actually changes.', 'start': 12813.138, 'duration': 5.945}, {'end': 12820.424, 'text': 'okay, right here.', 'start': 12819.083, 'duration': 1.341}, {'end': 12825.833, 'text': 'so we are sure that this will be unique.', 'start': 12821.59, 'duration': 4.243}, {'end': 12835.94, 'text': "so it's there's very small chance to create, to generate two random strings of length eight with the same, like the sequence of the characters.", 'start': 12825.833, 'duration': 10.107}, {'end': 12838.902, 'text': "okay, there's very, very small chance for that.", 'start': 12835.94, 'duration': 2.962}, {'end': 12842.365, 'text': 'so we are creating a unique path for that image.', 'start': 12838.902, 'duration': 3.463}, {'end': 12850.052, 'text': 'Okay, and that image path can be used down below when making insert in the database.', 'start': 12842.945, 'duration': 7.107}, {'end': 12853.615, 'text': "Okay, so I'm going to specify image path right here.", 'start': 12850.492, 'duration': 3.123}, {'end': 12859.421, 'text': 'However, that image path is also created inside the if statement right here.', 'start': 12854.236, 'duration': 5.185}, {'end': 12868.147, 'text': "okay, and if the image is not uploaded on the following line, we're going to see an error that the image path does not exist.", 'start': 12859.961, 'duration': 8.186}, {'end': 12871.409, 'text': "so let's just create that image path.", 'start': 12868.147, 'duration': 3.262}, {'end': 12874.211, 'text': 'right here equals to an empty string.', 'start': 12871.409, 'duration': 2.802}, {'end': 12884.729, 'text': "okay, now i'm going to create a folder with this random string path and then upload image inside.", 'start': 12874.211, 'duration': 10.518}, {'end': 12890.975, 'text': "so i'm going to use mkdir again and specify right here dirname function.", 'start': 12884.729, 'duration': 6.246}, {'end': 12897.26, 'text': 'so the dirname function accepts the file path and returns the directory where that file path is located.', 'start': 12890.975, 'duration': 6.285}, {'end': 12904.965, 'text': "so I'm going to specify image path, which is the following image, and it will return the following path.", 'start': 12897.84, 'duration': 7.125}, {'end': 12914.05, 'text': 'so we have to create directory with the following path and when we do this we can already run the move uploaded file.', 'start': 12904.965, 'duration': 9.085}, {'end': 12925.718, 'text': 'but right here we need to specify actual image path where we want to upload that image and save that and refresh and have a look.', 'start': 12914.05, 'duration': 11.668}, {'end': 12930.507, 'text': 'so something is actually wrong.', 'start': 12925.718, 'duration': 4.789}, {'end': 12931.428, 'text': 'no, nothing is wrong.', 'start': 12930.507, 'duration': 0.921}, {'end': 12936.334, 'text': "let's have a look in the database, refresh it and right here we see that image.", 'start': 12931.428, 'duration': 4.906}, {'end': 12940.039, 'text': 'okay, so this is the product and here we have that image.', 'start': 12936.334, 'duration': 3.705}, {'end': 12945.946, 'text': 'and if we have a look in the file system on the left side we see images folder.', 'start': 12940.039, 'duration': 5.907}, {'end': 12954.075, 'text': 'inside images folder we see that random name and inside that random name we see that image which we just uploaded.', 'start': 12945.946, 'duration': 8.129}, {'end': 12959.12, 'text': "okay, so i'm going to delete that files.", 'start': 12954.075, 'duration': 5.045}, {'end': 12964.886, 'text': 'okay, and that is basically all about creating a creating product.', 'start': 12959.12, 'duration': 5.766}, {'end': 12976.967, 'text': 'okay, the last thing what we need to do is to redirect user to the index page when the product is actually created.', 'start': 12967.819, 'duration': 9.148}, {'end': 12986.114, 'text': "okay, so for this i'm going to use header function and i'm going to specify the header which basically points to redirect.", 'start': 12976.967, 'duration': 9.147}, {'end': 12990.978, 'text': 'so location header corresponds to index.php.', 'start': 12986.114, 'duration': 4.864}, {'end': 12998.123, 'text': "okay, let's just redirect user to the index.php and save it and go to the products.", 'start': 12990.978, 'duration': 7.145}, {'end': 13006.288, 'text': "crud, let's just remove it files, we don't need that, and let's just create one product.", 'start': 12998.123, 'duration': 8.165}, {'end': 13014.832, 'text': 'okay, galaxy note 20 okay, with some description, with optional description, with some price.', 'start': 13006.288, 'duration': 8.544}, {'end': 13025.38, 'text': "okay, and let's choose image as well and hit the submit and we are redirected to the index page and we see galaxy note 20 right here.", 'start': 13014.832, 'duration': 10.548}, {'end': 13029.305, 'text': 'if we have a look in the database, we see that it has also image.', 'start': 13025.38, 'duration': 3.925}, {'end': 13035.293, 'text': 'however, if i create one product without an image, we should not see that.', 'start': 13029.305, 'duration': 5.988}, {'end': 13041.196, 'text': 'okay, so refresh right here and here we have another problem.', 'start': 13035.834, 'duration': 5.362}, {'end': 13047.119, 'text': 'so we basically see that images slash in the folder, so which is not correct.', 'start': 13041.196, 'duration': 5.923}, {'end': 13048.5, 'text': 'so we have a problem.', 'start': 13047.119, 'duration': 1.381}, {'end': 13050.041, 'text': 'we need to fix that.', 'start': 13048.5, 'duration': 1.541}, {'end': 13056.928, 'text': 'okay, and this actually happens because that image was actually existed.', 'start': 13050.041, 'duration': 6.887}, {'end': 13069.823, 'text': "okay. so if i dump that image right here, okay, and exit immediately, okay, let's go to the products page and create test product with price hit the enter.", 'start': 13056.928, 'duration': 12.895}, {'end': 13071.084, 'text': 'this is our image.', 'start': 13069.823, 'duration': 1.261}, {'end': 13076.886, 'text': "so even though we didn't choose image, it still exists, with everything empty.", 'start': 13071.084, 'duration': 5.802}, {'end': 13078.387, 'text': 'but it still exists.', 'start': 13076.886, 'duration': 1.501}, {'end': 13086.55, 'text': 'so we need to check right here if image exists and the image also has tmp name.', 'start': 13078.387, 'duration': 8.163}, {'end': 13094.012, 'text': "in this case, let's run the following code okay, so let's just remove this var, dump, refresh it,", 'start': 13086.55, 'duration': 7.462}, {'end': 13099.353, 'text': "let's have a look in the database and the last product doesn't have image at all.", 'start': 13094.012, 'duration': 5.341}, {'end': 13103.854, 'text': "okay, perfect, now it's time to implement outputting image right here.", 'start': 13099.353, 'duration': 4.501}, {'end': 13112.235, 'text': "okay. so let's go to the index.php, scroll down and right here we need to output that image.", 'start': 13103.854, 'duration': 8.381}, {'end': 13113.836, 'text': "okay, so it's very easy.", 'start': 13112.235, 'duration': 1.601}, {'end': 13122.297, 'text': 'now we have to create image tag with the source and right here we have to output product image.', 'start': 13113.836, 'duration': 8.461}, {'end': 13127.04, 'text': 'okay, just like this, save and refresh.', 'start': 13122.297, 'duration': 4.743}, {'end': 13131.902, 'text': 'and here we see that huge image which we should not see, of course, that huge.', 'start': 13127.04, 'duration': 4.862}, {'end': 13134.083, 'text': "so I'm going to open up CSS.", 'start': 13131.902, 'duration': 2.181}, {'end': 13141.666, 'text': "actually I'm going to give also that image class, image tag, some class.", 'start': 13134.083, 'duration': 7.583}, {'end': 13150.232, 'text': "okay. so let's give it a class of, like the thumb image, okay.", 'start': 13141.666, 'duration': 8.566}, {'end': 13157.017, 'text': "so let's go to the app.css and give it a width of 50 pixel.", 'start': 13150.232, 'duration': 6.785}, {'end': 13167.046, 'text': 'okay, save it and refresh, and probably we need to clear cache and refresh like that right click, empty cache and hard reload.', 'start': 13157.017, 'duration': 10.029}, {'end': 13170.408, 'text': 'and here we see that product images.', 'start': 13167.906, 'duration': 2.502}, {'end': 13174.63, 'text': 'okay, for this one it is broken because it just has a folder.', 'start': 13170.408, 'duration': 4.222}, {'end': 13176.171, 'text': "it doesn't have an actual image.", 'start': 13174.63, 'duration': 1.541}, {'end': 13181.533, 'text': "okay. so now it's time to implement delete and then update.", 'start': 13176.171, 'duration': 5.362}, {'end': 13186.576, 'text': "okay, but first let's do delete, because it's easier and we can clean up some products.", 'start': 13181.533, 'duration': 5.043}, {'end': 13188.837, 'text': 'okay, so How to do that?', 'start': 13186.576, 'duration': 2.261}, {'end': 13196.881, 'text': "Let's go to the index.php and whenever we click the delete button, it should redirect us to the delete.php.", 'start': 13189.177, 'duration': 7.704}, {'end': 13202.464, 'text': "So I'm going to change this into an anchor link inside href.", 'start': 13197.401, 'duration': 5.063}, {'end': 13211.688, 'text': "I'm going to provide delete.php and I'm going to pass the id of the product which I want to delete.", 'start': 13202.904, 'duration': 8.784}, {'end': 13215.71, 'text': "okay and i'm going to pass this as a query string.", 'start': 13212.188, 'duration': 3.522}, {'end': 13222.354, 'text': 'okay, id corresponds to product id.', 'start': 13215.71, 'duration': 6.644}, {'end': 13228.878, 'text': 'okay, now, if i refresh and click the delete, i see in the url delete.', 'start': 13222.354, 'duration': 6.524}, {'end': 13231.54, 'text': 'php id equals 13..', 'start': 13228.878, 'duration': 2.662}, {'end': 13235.882, 'text': 'if i click this on another product i see id equals 11.', 'start': 13231.54, 'duration': 4.342}, {'end': 13239.085, 'text': 'so we have to create that delete php.', 'start': 13235.882, 'duration': 3.203}, {'end': 13249.894, 'text': "so let's go to the product, scrot, right click and let's just create delete php and we have to get that id from the get.", 'start': 13239.085, 'duration': 10.809}, {'end': 13255.899, 'text': "super global, get, select the product and delete, or just don't select immediately, delete.", 'start': 13249.894, 'duration': 6.005}, {'end': 13259.702, 'text': "okay, so let's take out the id.", 'start': 13255.899, 'duration': 3.803}, {'end': 13263.339, 'text': 'so id equals from superglobal.', 'start': 13259.702, 'duration': 3.637}, {'end': 13266.32, 'text': "get, let's just take id.", 'start': 13263.339, 'duration': 2.981}, {'end': 13271.922, 'text': "okay, but here's one important thing also, which to which needs to be considered.", 'start': 13266.32, 'duration': 5.602}, {'end': 13274.683, 'text': 'okay, the id might not be given.', 'start': 13271.922, 'duration': 2.761}, {'end': 13277.264, 'text': 'okay, so we might access this.', 'start': 13274.683, 'duration': 2.581}, {'end': 13279.025, 'text': 'we have possibility for that.', 'start': 13277.264, 'duration': 1.761}, {'end': 13282.486, 'text': 'we might access this without the qr string.', 'start': 13279.025, 'duration': 3.461}, {'end': 13285.227, 'text': 'in this case we have an error undefined index id.', 'start': 13282.486, 'duration': 2.741}, {'end': 13287.228, 'text': 'so what we need to do right here?', 'start': 13285.227, 'duration': 2.001}, {'end': 13290.894, 'text': 'if that get id exists, then take that id.', 'start': 13287.228, 'duration': 3.666}, {'end': 13292.399, 'text': 'otherwise take null.', 'start': 13290.894, 'duration': 1.505}, {'end': 13295.871, 'text': 'okay, and we need to check if id does not exist.', 'start': 13292.399, 'duration': 3.472}, {'end': 13303.674, 'text': 'if not id, then redirect user to the index php.', 'start': 13297.688, 'duration': 5.986}, {'end': 13307.398, 'text': "okay, location index php, and that's it.", 'start': 13303.674, 'duration': 3.724}, {'end': 13309.88, 'text': 'we can put exit right here as well.', 'start': 13307.398, 'duration': 2.482}, {'end': 13315.346, 'text': 'okay, refresh and we are redirected to the index.php, which is good.', 'start': 13309.88, 'duration': 5.466}, {'end': 13321.651, 'text': 'okay, now we can actually implement and delete that product based on the id.', 'start': 13315.346, 'duration': 6.305}, {'end': 13325.673, 'text': "but i'm going to show you one thing which is also good to consider.", 'start': 13321.651, 'duration': 4.022}, {'end': 13330.755, 'text': 'okay so, because when we click that button it makes change in the database.', 'start': 13325.673, 'duration': 5.082}, {'end': 13333.837, 'text': 'it actually deletes a record in the database.', 'start': 13330.755, 'duration': 3.082}, {'end': 13336.778, 'text': "it's better to do this using method post.", 'start': 13333.837, 'duration': 2.941}, {'end': 13339.48, 'text': 'okay, how to do that?', 'start': 13336.778, 'duration': 2.702}, {'end': 13344.522, 'text': "so in the index.php i'm gonna revert this back into button.", 'start': 13339.48, 'duration': 5.042}, {'end': 13347.464, 'text': "okay, and i'm gonna put this button inside form.", 'start': 13344.522, 'duration': 2.942}, {'end': 13356.755, 'text': "okay, and inside that form i'm going to create also one input which will be input type hidden,", 'start': 13348.988, 'duration': 7.767}, {'end': 13363.36, 'text': 'which will have name of id and the value of the product id.', 'start': 13356.755, 'duration': 6.605}, {'end': 13374.468, 'text': 'okay, so, and that button basically does not need href anymore and its type should be not button but submit.', 'start': 13363.36, 'duration': 11.108}, {'end': 13377.489, 'text': 'okay, so whenever i click that button,', 'start': 13374.468, 'duration': 3.021}, {'end': 13390.015, 'text': 'it should submit that form with method of post and it should submit that on delete php and it will send that id as a post value.', 'start': 13377.489, 'duration': 12.526}, {'end': 13401.801, 'text': 'okay, so now, if i create that delete php and take that id from post instead of get and just dump this id right here, we will see that id.', 'start': 13390.015, 'duration': 11.786}, {'end': 13403.462, 'text': 'okay, so refresh.', 'start': 13401.801, 'duration': 1.661}, {'end': 13408.546, 'text': 'so. by the way, these buttons are now not next to each other, but they are stacked.', 'start': 13403.462, 'duration': 5.084}, {'end': 13412.168, 'text': 'so this is because the form is a block level element.', 'start': 13408.546, 'duration': 3.622}, {'end': 13417.091, 'text': "so we have to specify right here that its display is inline block and that's it.", 'start': 13412.168, 'duration': 4.923}, {'end': 13419.753, 'text': 'so we will see them next to each other.', 'start': 13417.091, 'duration': 2.662}, {'end': 13428.079, 'text': "so i click the delete and i see that id taken from the post and i don't see that id also in the url.", 'start': 13419.753, 'duration': 8.326}, {'end': 13433.462, 'text': 'okay, now we need to connect to the database and delete that product.', 'start': 13428.079, 'duration': 5.383}, {'end': 13437.945, 'text': "okay, so i'm going to copy the connection string.", 'start': 13433.462, 'duration': 4.483}, {'end': 13444.349, 'text': "okay, again, i'm highlighting that we are doing this not in an optimal way.", 'start': 13437.945, 'duration': 6.404}, {'end': 13450.052, 'text': 'we are just focused on to achieve our purpose as as quickly as possible.', 'start': 13444.349, 'duration': 5.703}, {'end': 13453.634, 'text': "just i'm trying to teach you as much as i can.", 'start': 13450.052, 'duration': 3.582}, {'end': 13459.938, 'text': "okay, and then we're going to change this and make this improved version and we're going to learn also some new techniques.", 'start': 13453.634, 'duration': 6.304}, {'end': 13470.082, 'text': "so in the delete PHP I'm going to paste this and we have to actually make delete.", 'start': 13460.698, 'duration': 9.384}, {'end': 13473.244, 'text': 'we have to actually create prepare statement down below.', 'start': 13470.082, 'duration': 3.162}, {'end': 13475.625, 'text': 'okay, if ID exists.', 'start': 13473.244, 'duration': 2.381}, {'end': 13481.708, 'text': 'okay, in this case we have to run prepare.', 'start': 13475.625, 'duration': 6.083}, {'end': 13490.725, 'text': 'that should be delete from products where id equals colon id.', 'start': 13481.708, 'duration': 9.017}, {'end': 13496.486, 'text': 'okay, we have to save that statement.', 'start': 13490.725, 'duration': 5.761}, {'end': 13504.205, 'text': 'oops statement and we have to bind bind value.', 'start': 13496.486, 'duration': 7.719}, {'end': 13506.886, 'text': 'okay, so this is the colon id.', 'start': 13504.205, 'duration': 2.681}, {'end': 13508.626, 'text': 'so we have to bind.', 'start': 13506.886, 'duration': 1.74}, {'end': 13515.269, 'text': 'colon id corresponds to id and we have to run, execute on that.', 'start': 13508.626, 'duration': 6.643}, {'end': 13516.93, 'text': "if it's we.", 'start': 13515.269, 'duration': 1.661}, {'end': 13521.912, 'text': 'if it is not able to update that to delete that product, it will throw an exception.', 'start': 13516.93, 'duration': 4.982}, {'end': 13531.296, 'text': "however, if it didn't throw an exception, it successfully deleted and we're going to redirect user to the index php.", 'start': 13521.912, 'duration': 9.384}, {'end': 13543.02, 'text': "save it go to the product index page and i'm going to hit the delete button right here and you see that the product is deleted.", 'start': 13533.257, 'duration': 9.763}, {'end': 13547.481, 'text': "okay, so let's just delete unnecessary ones.", 'start': 13543.02, 'duration': 4.461}, {'end': 13555.984, 'text': "cool, we can also check the database that we don't have that much records here we have.", 'start': 13547.481, 'duration': 8.503}, {'end': 13558.827, 'text': 'we have only six records now.', 'start': 13555.984, 'duration': 2.843}, {'end': 13561.59, 'text': 'okay, so we successfully implemented delete.', 'start': 13558.827, 'duration': 2.763}, {'end': 13564.633, 'text': "now it's time to implement update.", 'start': 13561.59, 'duration': 3.043}, {'end': 13569.477, 'text': "okay, so let's go to the index.php and i'm going to change this into anchor link.", 'start': 13564.633, 'duration': 4.844}, {'end': 13573.301, 'text': "i'm going to add right there update.php.", 'start': 13569.477, 'duration': 3.824}, {'end': 13577.586, 'text': 'question mark id equals to the product id.', 'start': 13573.301, 'duration': 4.285}, {'end': 13590.925, 'text': 'okay, we are not going to use form end button, just like we did for the delete, because that just opens the form that does not run the actual update.', 'start': 13579.454, 'duration': 11.471}, {'end': 13593.747, 'text': 'okay, so it should be anchor link.', 'start': 13590.925, 'duration': 2.822}, {'end': 13596.129, 'text': 'with updates we pass the id.', 'start': 13593.747, 'duration': 2.382}, {'end': 13597.911, 'text': "we don't need that button.", 'start': 13596.129, 'duration': 1.782}, {'end': 13599.533, 'text': "okay, and that's it.", 'start': 13597.911, 'duration': 1.622}, {'end': 13602.415, 'text': "so we don't have, of course, that update php.", 'start': 13599.533, 'duration': 2.882}, {'end': 13606.198, 'text': 'so if i just click the edit, it will show this not found.', 'start': 13602.415, 'duration': 3.783}, {'end': 13615.485, 'text': "so let's go ahead and create that update.php and we need to copy and paste couple of logics right here.", 'start': 13606.198, 'duration': 9.287}, {'end': 13621.47, 'text': 'okay, so we have to actually render the same form we are rendering in the create.php.', 'start': 13615.485, 'duration': 5.985}, {'end': 13630.638, 'text': 'right, so, but if is, if it is an update, we have to also display the user, not the user, sorry, but the image okay of the product.', 'start': 13621.47, 'duration': 9.168}, {'end': 13636.604, 'text': "so let's copy and paste these on update and let's make a couple of adjustments.", 'start': 13630.638, 'duration': 5.966}, {'end': 13646.794, 'text': "first of all, right here at the top we get the id okay, and if we didn't get the id, we need to redirect user to the index.php.", 'start': 13636.604, 'duration': 10.19}, {'end': 13657.811, 'text': "so i'm going to copy the following logic and paste right here and i'm going to take out now this from get not from post.", 'start': 13646.794, 'duration': 11.017}, {'end': 13663.135, 'text': "okay, and if we didn't provide id, it will redirect to the to the index.php.", 'start': 13657.811, 'duration': 5.324}, {'end': 13667.439, 'text': 'now we have to select the product based on that id.', 'start': 13663.135, 'duration': 4.304}, {'end': 13671.042, 'text': 'okay, so we create statement equals pdo.', 'start': 13667.439, 'duration': 3.603}, {'end': 13683.189, 'text': 'prepare, select everything from products where id equals colon id.', 'start': 13672.262, 'duration': 10.927}, {'end': 13686.831, 'text': 'okay, on statement, we bind value.', 'start': 13683.189, 'duration': 3.642}, {'end': 13691.364, 'text': 'This is going to be the ID ID right here.', 'start': 13688.962, 'duration': 2.402}, {'end': 13694.386, 'text': "And then I'm going to call execute.", 'start': 13692.064, 'duration': 2.322}, {'end': 13704.913, 'text': "And then I'm going to call fetch and not fetch all, just fetch and specify PDO fetch associative array.", 'start': 13695.146, 'duration': 9.767}, {'end': 13707.733, 'text': "and that's going to be the product i want.", 'start': 13705.453, 'duration': 2.28}, {'end': 13713.494, 'text': "okay, and i'm going to dump this product right now and exit.", 'start': 13707.733, 'duration': 5.761}, {'end': 13719.715, 'text': "don't continue, execution refresh and here we see that product we would like to update.", 'start': 13713.494, 'duration': 6.221}, {'end': 13729.317, 'text': "so if i provide another id right here, but let's just pick up the existing id, like the first one, for example okay, that's going to be iphone 11..", 'start': 13719.715, 'duration': 9.602}, {'end': 13732.898, 'text': "we have second id, that's going to be galaxy s20 and so on.", 'start': 13729.317, 'duration': 3.581}, {'end': 13741.98, 'text': 'now we have to populate form with the values and we should also display the actual image.', 'start': 13734.458, 'duration': 7.522}, {'end': 13743.961, 'text': 'okay, so we need to do that.', 'start': 13741.98, 'duration': 1.981}, {'end': 13748.602, 'text': "let's go to the update.php and scroll down.", 'start': 13743.961, 'duration': 4.641}, {'end': 13751.823, 'text': 'so the following code is executed when the method is post.', 'start': 13748.602, 'duration': 3.221}, {'end': 13755.044, 'text': "so it's not going to be executed when we open that form.", 'start': 13751.823, 'duration': 3.221}, {'end': 13756.065, 'text': "so let's just collapse this.", 'start': 13755.044, 'duration': 1.021}, {'end': 13758.805, 'text': 'for now we have that random string function.', 'start': 13756.065, 'duration': 2.74}, {'end': 13760.266, 'text': "so let's just leave this as it is.", 'start': 13758.805, 'duration': 1.461}, {'end': 13769.394, 'text': "scroll down and right here we have the errors and probably inside the form, right here let's just display the image.", 'start': 13761.006, 'duration': 8.388}, {'end': 13777.81, 'text': 'okay, so we do the following the product selected product has image there.', 'start': 13769.394, 'duration': 8.416}, {'end': 13780.272, 'text': "let's just display it.", 'start': 13777.81, 'duration': 2.462}, {'end': 13790.938, 'text': "okay, and if, and right here i'm going to display an image with the product image.", 'start': 13780.272, 'duration': 10.666}, {'end': 13793.251, 'text': 'okay, Excellent.', 'start': 13790.938, 'duration': 2.313}, {'end': 13795.292, 'text': "Let's have a look.", 'start': 13794.732, 'duration': 0.56}, {'end': 13796.833, 'text': 'So how this works.', 'start': 13795.652, 'duration': 1.181}, {'end': 13799.334, 'text': "So this product doesn't have image.", 'start': 13797.733, 'duration': 1.601}, {'end': 13801.455, 'text': "Let's go actually back.", 'start': 13799.874, 'duration': 1.581}, {'end': 13805.457, 'text': "So I'm going to create a backlink button from the update.php.", 'start': 13801.575, 'duration': 3.882}, {'end': 13807.057, 'text': 'So right here.', 'start': 13805.897, 'duration': 1.16}, {'end': 13810.819, 'text': "Actually, let's do a path.", 'start': 13807.077, 'duration': 3.742}, {'end': 13812.62, 'text': "So let's make a paragraph.", 'start': 13811.479, 'duration': 1.141}, {'end': 13819.383, 'text': "Inside the paragraph, I'm going to make an anchor link with href to index.php.", 'start': 13812.98, 'duration': 6.403}, {'end': 13824.79, 'text': 'go back to products.', 'start': 13821.044, 'duration': 3.746}, {'end': 13837.708, 'text': "okay, let's see, that should be probably btn, btn, btn, secondary refresh, and here we have it.", 'start': 13824.79, 'duration': 12.918}, {'end': 13842.391, 'text': "okay, let's click the edit on on the product which has image.", 'start': 13837.708, 'duration': 4.683}, {'end': 13846.054, 'text': 'so here i click edit and i see that huge image.', 'start': 13842.391, 'duration': 3.663}, {'end': 13851.117, 'text': "so i'm going to add a class on that image as well right here.", 'start': 13846.054, 'duration': 5.063}, {'end': 13854.879, 'text': "let's give it a class of update image.", 'start': 13851.117, 'duration': 3.762}, {'end': 13857.961, 'text': "i'm not going to give it a thumb image because it will be very small.", 'start': 13854.879, 'duration': 3.082}, {'end': 13859.863, 'text': "so let's make it update image.", 'start': 13857.961, 'duration': 1.902}, {'end': 13874.03, 'text': "let's go to the app.css and paste update image right here and let's give it a width of 120 pixels refresh, and this is our product image.", 'start': 13860.703, 'duration': 13.327}, {'end': 13878.952, 'text': 'if i want to change that product image, i have to choose another one.', 'start': 13874.03, 'duration': 4.922}, {'end': 13883.775, 'text': 'but the actual product title, product description and product price is not populated.', 'start': 13878.952, 'duration': 4.823}, {'end': 13892.658, 'text': "okay, let's scroll up inside that update php and we have that product title, price and description.", 'start': 13884.435, 'duration': 8.223}, {'end': 13902.281, 'text': 'and what we can do is that just select, take the title, price and description from that product, because it is an associative array.', 'start': 13892.658, 'duration': 9.623}, {'end': 13909.926, 'text': 'okay, so product price and product description.', 'start': 13902.281, 'duration': 7.645}, {'end': 13915.11, 'text': 'okay, save and refresh, and here we see, so it is there.', 'start': 13909.926, 'duration': 5.184}, {'end': 13919.254, 'text': 'probably the description is not provided for that special product.', 'start': 13915.11, 'duration': 4.144}, {'end': 13929.403, 'text': 'that should not be called by the way, create new product that should be called update product in the product title, update product,', 'start': 13919.254, 'duration': 10.149}, {'end': 13937.668, 'text': "and let's just make it product title.", 'start': 13929.403, 'duration': 8.265}, {'end': 13942.171, 'text': 'so this is good and okay.', 'start': 13937.668, 'duration': 4.503}, {'end': 13945.493, 'text': "now let's implement the actual updating of the product.", 'start': 13942.171, 'duration': 3.322}], 'summary': 'The transcript covers creating a random directory for image storage, uploading and displaying images, implementing delete and update functionalities, and populating form fields with product details.', 'duration': 36.379, 'max_score': 12759.047, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/2eebptXfEvw/pics/2eebptXfEvw12759047.jpg'}, {'end': 13279.025, 'src': 'embed', 'start': 13249.894, 'weight': 5, 'content': [{'end': 13255.899, 'text': "super global, get, select the product and delete, or just don't select immediately, delete.", 'start': 13249.894, 'duration': 6.005}, {'end': 13259.702, 'text': "okay, so let's take out the id.", 'start': 13255.899, 'duration': 3.803}, {'end': 13263.339, 'text': 'so id equals from superglobal.', 'start': 13259.702, 'duration': 3.637}, {'end': 13266.32, 'text': "get, let's just take id.", 'start': 13263.339, 'duration': 2.981}, {'end': 13271.922, 'text': "okay, but here's one important thing also, which to which needs to be considered.", 'start': 13266.32, 'duration': 5.602}, {'end': 13274.683, 'text': 'okay, the id might not be given.', 'start': 13271.922, 'duration': 2.761}, {'end': 13277.264, 'text': 'okay, so we might access this.', 'start': 13274.683, 'duration': 2.581}, {'end': 13279.025, 'text': 'we have possibility for that.', 'start': 13277.264, 'duration': 1.761}], 'summary': 'Using superglobal to get and possibly delete product by id.', 'duration': 29.131, 'max_score': 13249.894, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/2eebptXfEvw/pics/2eebptXfEvw13249894.jpg'}, {'end': 13769.394, 'src': 'embed', 'start': 13719.715, 'weight': 1, 'content': [{'end': 13729.317, 'text': "so if i provide another id right here, but let's just pick up the existing id, like the first one, for example okay, that's going to be iphone 11..", 'start': 13719.715, 'duration': 9.602}, {'end': 13732.898, 'text': "we have second id, that's going to be galaxy s20 and so on.", 'start': 13729.317, 'duration': 3.581}, {'end': 13741.98, 'text': 'now we have to populate form with the values and we should also display the actual image.', 'start': 13734.458, 'duration': 7.522}, {'end': 13743.961, 'text': 'okay, so we need to do that.', 'start': 13741.98, 'duration': 1.981}, {'end': 13748.602, 'text': "let's go to the update.php and scroll down.", 'start': 13743.961, 'duration': 4.641}, {'end': 13751.823, 'text': 'so the following code is executed when the method is post.', 'start': 13748.602, 'duration': 3.221}, {'end': 13755.044, 'text': "so it's not going to be executed when we open that form.", 'start': 13751.823, 'duration': 3.221}, {'end': 13756.065, 'text': "so let's just collapse this.", 'start': 13755.044, 'duration': 1.021}, {'end': 13758.805, 'text': 'for now we have that random string function.', 'start': 13756.065, 'duration': 2.74}, {'end': 13760.266, 'text': "so let's just leave this as it is.", 'start': 13758.805, 'duration': 1.461}, {'end': 13769.394, 'text': "scroll down and right here we have the errors and probably inside the form, right here let's just display the image.", 'start': 13761.006, 'duration': 8.388}], 'summary': 'Updating form with values and displaying images in php script.', 'duration': 49.679, 'max_score': 13719.715, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/2eebptXfEvw/pics/2eebptXfEvw13719715.jpg'}, {'end': 13942.171, 'src': 'embed', 'start': 13902.281, 'weight': 0, 'content': [{'end': 13909.926, 'text': 'okay, so product price and product description.', 'start': 13902.281, 'duration': 7.645}, {'end': 13915.11, 'text': 'okay, save and refresh, and here we see, so it is there.', 'start': 13909.926, 'duration': 5.184}, {'end': 13919.254, 'text': 'probably the description is not provided for that special product.', 'start': 13915.11, 'duration': 4.144}, {'end': 13929.403, 'text': 'that should not be called by the way, create new product that should be called update product in the product title, update product,', 'start': 13919.254, 'duration': 10.149}, {'end': 13937.668, 'text': "and let's just make it product title.", 'start': 13929.403, 'duration': 8.265}, {'end': 13942.171, 'text': 'so this is good and okay.', 'start': 13937.668, 'duration': 4.503}], 'summary': "Issue identified: missing product description, suggest renaming 'create new product' to 'update product'.", 'duration': 39.89, 'max_score': 13902.281, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/2eebptXfEvw/pics/2eebptXfEvw13902281.jpg'}, {'end': 15075.772, 'src': 'embed', 'start': 15048.4, 'weight': 2, 'content': [{'end': 15056.344, 'text': 'and if i decide that i want to add one additional input field right here, for example the product location, okay,', 'start': 15048.4, 'duration': 7.944}, {'end': 15061.606, 'text': 'i have to do this in the update.php and in the create.php as well.', 'start': 15056.344, 'duration': 5.262}, {'end': 15068.59, 'text': 'okay, i want this to be in a separate place, in a separate area which can be reusable.', 'start': 15061.606, 'duration': 6.984}, {'end': 15075.772, 'text': "okay, so inside that views i'm going to create a folder for products.", 'start': 15068.59, 'duration': 7.182}], 'summary': 'To add a new input field, modify update.php and create.php, aiming for reusability.', 'duration': 27.372, 'max_score': 15048.4, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/2eebptXfEvw/pics/2eebptXfEvw15048400.jpg'}], 'start': 12681.997, 'title': 'Php web development concepts', 'summary': 'Covers php file upload, image handling, delete functionality implementation, database operations for delete and update, product image and details update, product management, search implementation, and code refactoring for reusability.', 'chapters': [{'end': 13181.533, 'start': 12681.997, 'title': 'Php file upload and image handling', 'summary': 'Demonstrates creating a random directory for image uploads, ensuring unique file paths, and redirecting users upon successful product creation, with an issue fix for displaying images and handling cases when no image is uploaded.', 'duration': 499.536, 'highlights': ["Creating a random directory for image uploads The speaker explains how to generate a random string with a given length for creating a unique directory path, ensuring that images are saved in a separate 'images' folder and emphasizing the uniqueness of the generated paths.", 'Ensuring unique file paths for images The importance of generating unique file paths for uploaded images is emphasized, with the speaker highlighting the low probability of generating two random strings of length eight with the same sequence of characters.', "Redirecting users upon successful product creation The use of the 'header' function to redirect users to the index page upon successful product creation is demonstrated, with a practical example of creating a product and verifying the redirection.", 'Fixing the display of images and handling cases when no image is uploaded The speaker addresses an issue with incorrect image display caused by an existing but empty image, and explains the implementation of a check to handle cases when no image is uploaded, ensuring proper image output and database handling.']}, {'end': 13428.079, 'start': 13181.533, 'title': 'Implementing delete functionality in php', 'summary': 'Explains how to implement the delete functionality in php by redirecting to delete.php with the product id, handling the possibility of undefined id, and submitting the form with the post method to delete the product from the database.', 'duration': 246.546, 'highlights': ['Redirecting to delete.php with the product ID The chapter explains redirecting to delete.php with the product ID passed as a query string, enabling the deletion of the specific product.', 'Handling the possibility of undefined ID It explains how to handle the case where the ID might not be provided by checking if the get ID exists and redirecting the user to the index.php if the ID does not exist.', 'Submitting the form with the post method to delete the product from the database It demonstrates how to submit the form with the post method, sending the ID to delete.php, and then shows the ID being retrieved from the post and not visible in the URL.']}, {'end': 13719.715, 'start': 13428.079, 'title': 'Database operations: delete and update', 'summary': 'Covers the implementation of delete and update operations in php for a database, focusing on executing sql queries, preparing statements, and redirecting users, resulting in the successful deletion of records and the preparation for the update functionality.', 'duration': 291.636, 'highlights': ['The chapter covers the implementation of delete and update operations in PHP for a database It involves teaching the process of executing SQL queries in PHP for performing delete and update operations on a database.', 'focusing on executing SQL queries, preparing statements, and redirecting users The focus is on executing SQL queries, preparing statements, and redirecting users to achieve efficient database operations.', 'resulting in the successful deletion of records and the preparation for the update functionality The implementation leads to the successful deletion of records and prepares for the update functionality in the PHP application.']}, {'end': 14289.374, 'start': 13719.715, 'title': 'Updating product image and details', 'summary': 'Covers the process of updating product details and images, including handling form population, image display, and product information retrieval, with a focus on implementing the actual update process and resolving issues encountered during the process.', 'duration': 569.659, 'highlights': ['The process of updating product details and images is covered, including handling form population, image display, and product information retrieval. ', 'The actual updating of the product details is implemented in the update process. ', 'Issues encountered during the update process are resolved, such as the need to delete the old image and ensuring proper handling of image updates. ', 'Prompting for the need to specify the ID during the update process to avoid updating all products with the same details. ']}, {'end': 14550.899, 'start': 14289.955, 'title': 'Product management and search implementation', 'summary': 'Covers the implementation of creating, updating, and deleting products as well as the development of a search functionality, with examples of filtering and displaying specific products based on search queries using php and mysql.', 'duration': 260.944, 'highlights': ['The implementation of creating, updating, and deleting products is successfully demonstrated.', 'The detailed process of developing a search functionality, including filtering and displaying specific products based on search queries using PHP and MySQL, is thoroughly explained.', 'The method of assigning a value to the search input and its impact on displaying search results is described.']}, {'end': 15257.433, 'start': 14551.319, 'title': 'Refactoring code for reusability', 'summary': 'Discusses refactoring code for reusability, emphasizing the creation of separate folders for bad, better, and good versions, reusing code for connecting to the database, and combining create and update forms into a single one, while also highlighting the importance of using modern frameworks like laravel or codeigniter for larger projects.', 'duration': 706.114, 'highlights': ['The importance of creating separate folders for bad, better, and good versions of the code to facilitate refactoring and improvement, with the goal of achieving the best possible version. The speaker emphasizes the need to organize the code into separate folders for bad, better, and good versions, with the ultimate goal of achieving the best possible version, highlighting the importance of continuous improvement and refactoring.', 'Reusing code for connecting to the database to avoid repetition and maintainability issues, such as the need to update credentials in multiple places, and the process of consolidating the database connection code into a single file for better maintainability. The speaker discusses the issue of repeating database connection credentials in multiple places, emphasizing the importance of consolidating the code into a single file to improve maintainability and avoid the need to update credentials in multiple locations.', 'Combining create and update forms into a single form for reusability, including the creation of a separate folder for products and the encouragement to use modern frameworks like Laravel or CodeIgniter for larger projects. The speaker outlines the process of combining create and update forms into a single form for reusability, highlighting the creation of a separate folder for products and emphasizing the use of modern frameworks like Laravel or CodeIgniter for larger projects.']}], 'duration': 2575.436, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/2eebptXfEvw/pics/2eebptXfEvw12681997.jpg', 'highlights': ['The detailed process of developing a search functionality, including filtering and displaying specific products based on search queries using PHP and MySQL, is thoroughly explained.', 'The chapter covers the implementation of delete and update operations in PHP for a database, focusing on executing SQL queries, preparing statements, and redirecting users to achieve efficient database operations.', 'The process of updating product details and images is covered, including handling form population, image display, and product information retrieval.', 'The importance of creating separate folders for bad, better, and good versions of the code to facilitate refactoring and improvement, with the goal of achieving the best possible version.', 'Reusing code for connecting to the database to avoid repetition and maintainability issues, such as the need to update credentials in multiple places, and the process of consolidating the database connection code into a single file for better maintainability.', 'The implementation of creating, updating, and deleting products is successfully demonstrated.']}, {'end': 16611.405, 'segs': [{'end': 15530.709, 'src': 'embed', 'start': 15506.148, 'weight': 4, 'content': [{'end': 15515.676, 'text': 'so we have that validate product right here and that validate product basically creates a couple of variables like title, description and price.', 'start': 15506.148, 'duration': 9.528}, {'end': 15524.283, 'text': 'but we need also image path, so that image path should be also created inside the validate product, okay,', 'start': 15515.676, 'duration': 8.607}, {'end': 15530.709, 'text': 'and then that image path should be used down below, right here as well.', 'start': 15524.283, 'duration': 6.426}], 'summary': 'The validate product creates variables like title, description, and price. it also needs to include the image path for further use.', 'duration': 24.561, 'max_score': 15506.148, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/2eebptXfEvw/pics/2eebptXfEvw15506148.jpg'}, {'end': 15810.739, 'src': 'embed', 'start': 15774.28, 'weight': 1, 'content': [{'end': 15774.84, 'text': "let's have a look.", 'start': 15774.28, 'duration': 0.56}, {'end': 15779.805, 'text': "if the delete works, so i'm gonna delete that product and here it is.", 'start': 15774.84, 'duration': 4.965}, {'end': 15782.547, 'text': 'so it also works fine.', 'start': 15779.805, 'duration': 2.742}, {'end': 15786.431, 'text': 'however, this is not perfect version.', 'start': 15782.547, 'duration': 3.884}, {'end': 15790.674, 'text': 'okay, so we have to make a couple of changes right here also.', 'start': 15786.431, 'duration': 4.243}, {'end': 15803.797, 'text': 'so first of all, if we just um, have a look right here inside the index.php, we can actually access database.php.', 'start': 15790.674, 'duration': 13.123}, {'end': 15810.739, 'text': 'okay, we can also access functions.php and validate product.php.', 'start': 15803.797, 'duration': 6.942}], 'summary': 'Testing shows successful deletion, but further changes needed for perfection.', 'duration': 36.459, 'max_score': 15774.28, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/2eebptXfEvw/pics/2eebptXfEvw15774280.jpg'}, {'end': 16073.07, 'src': 'embed', 'start': 16017.621, 'weight': 2, 'content': [{'end': 16029.49, 'text': "okay, i'm gonna hit the enter and that starts that php development server and let's open port 8080 and we don't actually see anything because it searches for index.php.", 'start': 16017.621, 'duration': 11.869}, {'end': 16035.655, 'text': "okay, so let's open index.php, but there is no index.php in that public.", 'start': 16029.49, 'duration': 6.165}, {'end': 16039.318, 'text': 'right, index.php is inside that products.', 'start': 16035.655, 'duration': 3.663}, {'end': 16045.248, 'text': "so let's just open products, slash index.php.", 'start': 16039.318, 'duration': 5.93}, {'end': 16053.054, 'text': "i'm going to hit the enter and right here we see all the products and basically it will work in the same way as it was working before.", 'start': 16045.248, 'duration': 7.806}, {'end': 16056.476, 'text': 'however, we need to fix the css and images problem.', 'start': 16053.054, 'duration': 3.422}, {'end': 16060.499, 'text': 'okay, refresh this and we see how the css is included.', 'start': 16056.476, 'duration': 4.023}, {'end': 16063.521, 'text': 'so it is included from the products.', 'start': 16060.979, 'duration': 2.542}, {'end': 16065.203, 'text': 'slash up css.', 'start': 16063.521, 'duration': 1.682}, {'end': 16073.07, 'text': 'we need to change that and we need to include that using slash as an absolute path.', 'start': 16065.203, 'duration': 7.867}], 'summary': 'Started php development server, accessed products/index.php, fixed css and images problems.', 'duration': 55.449, 'max_score': 16017.621, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/2eebptXfEvw/pics/2eebptXfEvw16017621.jpg'}, {'end': 16388.405, 'src': 'embed', 'start': 16358.764, 'weight': 0, 'content': [{'end': 16363.868, 'text': "So we didn't have that images folder like before here, but it appeared.", 'start': 16358.764, 'duration': 5.104}, {'end': 16367.811, 'text': 'Okay So why does this happen? Okay.', 'start': 16364.489, 'duration': 3.322}, {'end': 16370.934, 'text': "So if I just delete this, I'm going to show you this once again.", 'start': 16368.452, 'duration': 2.482}, {'end': 16375.218, 'text': 'So if I just delete this and create one more product.', 'start': 16370.954, 'duration': 4.264}, {'end': 16379.76, 'text': 'with some test and some values.', 'start': 16376.638, 'duration': 3.122}, {'end': 16381.021, 'text': 'hit the submit.', 'start': 16379.76, 'duration': 1.261}, {'end': 16383.863, 'text': 'right here it creates that images folder.', 'start': 16381.021, 'duration': 2.842}, {'end': 16388.405, 'text': 'okay, so this happens from the validate product.', 'start': 16383.863, 'duration': 4.542}], 'summary': 'Validation process creates images folder when adding a new product.', 'duration': 29.641, 'max_score': 16358.764, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/2eebptXfEvw/pics/2eebptXfEvw16358764.jpg'}], 'start': 15257.433, 'title': 'Refactoring php code and file organization', 'summary': "Discusses refactoring php code for reusability and product management, improving file organization, using virtual hosts and php's built-in server, handling file system operations, and employing relative paths in php. it also emphasizes the benefits, such as reducing code duplication, organizing files, and resolving image display issues.", 'chapters': [{'end': 15308.047, 'start': 15257.433, 'title': 'Refactoring php code for reusability', 'summary': 'Discusses refactoring php code to improve reusability by creating a separate functions.php file, moving the common function into it, and including it in both update.php and create.php to avoid code repetition.', 'duration': 50.614, 'highlights': ['Creating a separate functions.php file to improve code reusability by moving the common function into it and including it in both update.php and create.php to avoid code repetition.', 'Removing the common function from update.php and including the functions.php file at the top to ensure reusability and avoid duplicated code.']}, {'end': 15939.106, 'start': 15308.067, 'title': 'Refactoring php code for product management', 'summary': 'Covers the refactoring of php code for product management, including reducing code duplication, moving logic to separate files, and organizing files into a web-accessible folder.', 'duration': 631.039, 'highlights': ["Refactoring code to reduce code duplication and improve organization The speaker discusses the need to refactor the PHP code to reduce code duplication and improve organization by moving logic to a separate file called 'validate product' and restructuring the file organization.", "Moving files to a web-accessible folder for better security practices The speaker emphasizes the importance of moving specific PHP files, like create, index, update, and delete, to a web-accessible folder for better security practices and mentions the creation of a 'public' folder for web-accessible files.", 'Adjusting file includes and requires after moving them to a new folder The speaker demonstrates the process of adjusting file includes and requires after moving the PHP files to a new folder by going back two directories and fixing the require once statements in all files.', "Improving file organization and access control by creating a 'public' folder The speaker highlights the benefits of improving file organization and access control by creating a 'public' folder and moving web-accessible PHP files into it, ensuring better security practices."]}, {'end': 16197.612, 'start': 15939.106, 'title': 'Virtual host and php development server', 'summary': "Discusses the importance of using virtual hosts and php's built-in server for developing real applications, highlighting the issues beginners face and the benefits of using absolute paths for including css.", 'duration': 258.506, 'highlights': ["Using virtual hosts and PHP's built-in server is a good practice for real application development and helps in resolving path issues for CSS inclusion. The chapter emphasizes the importance of creating a virtual host and running applications on it using PHP's built-in server. It highlights the benefits of this approach for resolving path issues related to CSS inclusion.", 'The use of absolute paths for including CSS avoids path struggles and ensures proper functioning of the CSS in the application. The chapter demonstrates the significance of using absolute paths for including CSS to avoid struggles with path detection and ensure proper functioning of the CSS in the application.', 'The traditional approach of creating separate files for each operation in CRUD applications leads to a large number of files, making maintenance challenging and not a good practice. The chapter discusses the drawbacks of the traditional approach in CRUD applications, highlighting the challenges of maintaining a large number of files for different operations and emphasizing that it is not considered a good practice.']}, {'end': 16388.405, 'start': 16197.612, 'title': 'Improving file organization and image display', 'summary': 'Discusses the process of improving file organization and image display, including moving images to the public folder, adjusting image paths, and resolving image display issues, as well as creating a new product and observing the folder creation as a result of product validation.', 'duration': 190.793, 'highlights': ['The process of improving file organization involves moving all images inside the public folder to ensure correct display and including the necessary slashes in the image paths for proper rendering.', "Resolving image display issues includes adjusting image inclusions in the create PHP file and observing the creation of an 'images' folder within the 'products' directory as a result of product validation.", "Creating a new product and observing the automatic creation of an 'images' folder within the 'products' directory as a result of product validation.", 'Switching to a more secure and correct URL for continued work and considering the creation of a virtual host for future use.']}, {'end': 16611.405, 'start': 16388.405, 'title': 'File system operations and relative paths', 'summary': 'Explains how to handle file system operations and use relative paths in php, emphasizing the importance of prefixing paths with the current directory and demonstrating the use of magic constant dir for achieving this. it also showcases the successful upload of an image to the specified folder and highlights the need for improvement in the current version of the system.', 'duration': 223, 'highlights': ['The chapter emphasizes the importance of prefixing paths with the current directory for file system operations in PHP, demonstrating the use of magic constant dir to achieve this.', 'It showcases the successful upload of an image to the specified folder, proving the effectiveness of the approach.', 'The chapter acknowledges the need for improvement in the current version of the system, indicating that it is not a good version.', 'It mentions the functionality of the search feature, confirming its proper working condition.']}], 'duration': 1353.972, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/2eebptXfEvw/pics/2eebptXfEvw15257433.jpg', 'highlights': ['Creating a separate functions.php file to improve code reusability by moving the common function into it and including it in both update.php and create.php to avoid code repetition.', "Refactoring code to reduce code duplication and improve organization by moving logic to a separate file called 'validate product' and restructuring the file organization.", 'Moving files to a web-accessible folder for better security practices and adjusting file includes and requires after moving them to a new folder.', "Using virtual hosts and PHP's built-in server is a good practice for real application development and helps in resolving path issues for CSS inclusion.", 'The process of improving file organization involves moving all images inside the public folder to ensure correct display and including the necessary slashes in the image paths for proper rendering.', 'The chapter emphasizes the importance of prefixing paths with the current directory for file system operations in PHP, demonstrating the use of magic constant dir to achieve this.']}, {'end': 18515.286, 'segs': [{'end': 16666.568, 'src': 'embed', 'start': 16636.806, 'weight': 2, 'content': [{'end': 16638.407, 'text': 'and because this is the crash course.', 'start': 16636.806, 'duration': 1.601}, {'end': 16640.669, 'text': 'this is for absolute beginners.', 'start': 16638.407, 'duration': 2.262}, {'end': 16641.79, 'text': 'we need that knowledge.', 'start': 16640.669, 'duration': 1.121}, {'end': 16649.534, 'text': 'so we need to write bad code to learn how to improve that code and how to make our code better,', 'start': 16641.79, 'duration': 7.744}, {'end': 16653.537, 'text': "and we need to also see what's the difference between the bad code and the good code.", 'start': 16649.534, 'duration': 4.003}, {'end': 16657.52, 'text': 'okay, so we need to know that this code is not good.', 'start': 16653.937, 'duration': 3.583}, {'end': 16666.568, 'text': "it is actually bad code, and probably these such kind of codes are the reason why many people actually don't like php.", 'start': 16657.52, 'duration': 9.048}], 'summary': 'A crash course for beginners to learn coding by analyzing bad code and striving for improvement.', 'duration': 29.762, 'max_score': 16636.806, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/2eebptXfEvw/pics/2eebptXfEvw16636806.jpg'}, {'end': 18399.951, 'src': 'embed', 'start': 18349.947, 'weight': 0, 'content': [{'end': 18352.189, 'text': 'what is this refresh?', 'start': 18349.947, 'duration': 2.242}, {'end': 18359.453, 'text': 'and right here we see that the function which needs to be executed is app controllers, product controllers, index.', 'start': 18352.189, 'duration': 7.264}, {'end': 18368.959, 'text': "so if we just put right here create, then we see an error problem on router php's line 37.", 'start': 18359.453, 'duration': 9.506}, {'end': 18377.823, 'text': "so let's have a look 37 right here inside the get roads we don't have anything configured for slash create.", 'start': 18368.959, 'duration': 8.864}, {'end': 18382.625, 'text': "That's obvious because we have configured slash products slash create.", 'start': 18378.163, 'duration': 4.462}, {'end': 18391.088, 'text': "So we might have other crowds in our application, right? It might be for orders or invoices, and that's why we need that products create.", 'start': 18383.025, 'duration': 8.063}, {'end': 18399.951, 'text': 'So in this case, if we just try to access a non-existing URL, not configured URL, we should show not found to the user.', 'start': 18391.528, 'duration': 8.423}], 'summary': 'Identifying error in router php, need to configure url for products create to show not found for non-existing urls.', 'duration': 50.004, 'max_score': 18349.947, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/2eebptXfEvw/pics/2eebptXfEvw18349947.jpg'}], 'start': 16611.405, 'title': 'Improving code quality and implementing php features', 'summary': 'Covers improving code quality with php and composer, emphasizing refactoring bad code, using namespaces and autoloading, implementing custom routing and a mini mvc framework, and showcasing practical examples with composer and guzzle http client.', 'chapters': [{'end': 16707.686, 'start': 16611.405, 'title': 'Improving code quality with php and composer', 'summary': 'Emphasizes the need to write and refactor bad code to learn how to improve it, and it discusses the use of composer for auto loading classes and custom routing for building a better version of a product crud application.', 'duration': 96.281, 'highlights': ['The chapter stresses the importance of writing bad code to learn how to improve it and highlights the need to refactor code, split it into different files, and work with common problems. This approach is aimed at helping absolute beginners understand how to make their code better. This insight is valuable for beginners looking to understand code improvement, and it provides a practical approach for learning.', 'The use of Composer for auto loading classes and custom routing for rebuilding a product CRUD application is emphasized. This is crucial for understanding the difference between bad and good code, and it offers practical insights for building a better version of the application. These concepts are important for improving code quality and understanding the practical implementation of Composer and custom routing.']}, {'end': 16918.108, 'start': 16707.686, 'title': 'Namespaces and autoloading in php', 'summary': 'Explains the necessity of namespaces in php to avoid name collision and how to enable autoloading using composer, which simplifies the class loading process and provides advantages like code organization and eliminating manual require statements.', 'duration': 210.422, 'highlights': ['Namespaces provide a solution to name collision in PHP classes. By using namespaces, conflicts between classes with the same name from different sources are avoided, as each class is identified with its full namespace, e.g., app-backslash-email.', 'Autoloading in PHP is simplified by using Composer. Composer simplifies the class loading process by automatically including the necessary classes, eliminating the need for manual require statements and providing advantages like code organization and improved maintainability.', 'Composer installation enables the use of autoloading in PHP. The process involves downloading Composer for the respective operating system, installing it, and then using the Composer command from the command line to enable autoloading.']}, {'end': 17546.856, 'start': 16918.108, 'title': 'Namespaces & autoloading in action', 'summary': 'Demonstrates the implementation of namespaces, autoloading, and composer in php, showcasing the advantages of autoloading and the ease of installing and using third-party packages with composer, with examples of guzzle http client usage.', 'duration': 628.748, 'highlights': ['Autoloading avoids manual require_once statements for classes, interfaces, and traits, offering efficiency as the application scales. Autoloading eliminates the need for require_once statements, providing efficiency as the application grows with hundreds of classes interdependent on each other.', 'Composer facilitates the installation and usage of third-party packages, demonstrated with the installation and usage of Guzzle HTTP client. Composer simplifies the installation and usage of third-party packages, exemplified by the installation and usage of Guzzle HTTP client, showcasing its ease of use and dependency management.', 'The installation of Guzzle HTTP client with composer resulted in the installation of six packages, demonstrating the automated handling of dependencies. The installation of Guzzle HTTP client with composer led to the installation of six packages, highlighting the automated management and installation of dependencies by composer.']}, {'end': 18110.516, 'start': 17547.176, 'title': 'Implementing custom routing and mvc framework', 'summary': 'Discusses implementing custom routing and a mini mvc framework for a products crud application, along with configuring a custom router, creating controller classes and specifying namespaces.', 'duration': 563.34, 'highlights': ['The chapter discusses implementing custom routing and a mini MVC framework The speaker talks about rewriting the products CRUD application using custom routing and implementing a mini MVC framework, highlighting the importance of using popular frameworks like Laravel or Symfony for the best versions.', 'Configuring a custom router for different types of requests and specifying namespaces The speaker explains the process of configuring a custom router to handle GET and POST requests, creating controller classes, and specifying namespaces for the controllers and autoload using composer.json.', 'Creating controller classes and specifying namespaces for models, views, and controllers The speaker demonstrates the creation of controllers, such as the main controller and product controller, and specifies namespaces for models, views, and controllers, emphasizing the need for an MVC structure.']}, {'end': 18515.286, 'start': 18110.516, 'title': 'Implementing router in php', 'summary': 'Discusses configuring routes, creating functions for get and post methods, detecting the current route, and handling non-existing urls, with a focus on using super global server variables and executing functions based on current url and method.', 'duration': 404.77, 'highlights': ['Configuring routes and creating functions for GET and POST methods The transcript covers configuring routes and creating functions for GET and POST methods to handle different types of requests.', 'Detecting the current route using super global server variables The discussion involves using super global server variables to detect the current route and make decisions based on the path info and request method.', "Handling non-existing URLs by displaying 'page not found' to the user The chapter addresses handling non-existing URLs by displaying 'page not found' to the user and using conditional statements to execute functions or display an error message accordingly."]}], 'duration': 1903.881, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/2eebptXfEvw/pics/2eebptXfEvw16611404.jpg', 'highlights': ['The chapter emphasizes the importance of refactoring bad code and splitting it into different files, providing practical insights for beginners.', 'Using Composer for autoloading classes and custom routing is crucial for understanding code improvement and offers practical insights for building a better application.', 'Namespaces in PHP provide a solution to name collision, avoiding conflicts between classes from different sources.', 'Autoloading in PHP is simplified by using Composer, eliminating the need for manual require statements and improving maintainability.', 'Composer facilitates the installation and usage of third-party packages, exemplified by the installation and usage of Guzzle HTTP client.', 'Autoloading avoids manual require_once statements, providing efficiency as the application scales with interdependent classes.', 'Implementing custom routing and a mini MVC framework highlights the importance of using popular frameworks for the best versions.', 'Configuring a custom router for different types of requests and specifying namespaces is essential for creating a structured application.', 'The chapter covers configuring routes and creating functions for GET and POST methods to handle different types of requests.']}, {'end': 20441.38, 'segs': [{'end': 18623.689, 'src': 'embed', 'start': 18592.849, 'weight': 2, 'content': [{'end': 18599.895, 'text': "so let's create public pdo, pdo, pdo.", 'start': 18592.849, 'duration': 7.046}, {'end': 18604.697, 'text': "so i'm telling that the pdo variable pdo property is an instance of the pdo.", 'start': 18599.895, 'duration': 4.802}, {'end': 18608.8, 'text': 'so the type is a feature of php 7.4.', 'start': 18604.697, 'duration': 4.103}, {'end': 18613.442, 'text': "if you don't have php 7.4, you probably won't be able to not.", 'start': 18608.8, 'duration': 4.642}, {'end': 18617.825, 'text': "probably you won't be able to actually write here and you will have a syntax error.", 'start': 18613.442, 'duration': 4.383}, {'end': 18620.767, 'text': 'so you can also leave like this.', 'start': 18618.405, 'duration': 2.362}, {'end': 18623.689, 'text': 'i can also leave like this and it will work.', 'start': 18620.767, 'duration': 2.922}], 'summary': 'Using pdo in php 7.4 is a key feature, enabling proper instantiation and syntax error prevention.', 'duration': 30.84, 'max_score': 18592.849, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/2eebptXfEvw/pics/2eebptXfEvw18592849.jpg'}, {'end': 18804.924, 'src': 'embed', 'start': 18775.513, 'weight': 1, 'content': [{'end': 18786.857, 'text': 'so now we need to call that get products method from the product controller from here, but how to actually do this?', 'start': 18775.513, 'duration': 11.344}, {'end': 18789.898, 'text': 'and we also need to render form.', 'start': 18786.857, 'duration': 3.041}, {'end': 18796.081, 'text': "okay. so let's do things step by step and let's say that i only want to render the form.", 'start': 18789.898, 'duration': 6.183}, {'end': 18804.924, 'text': "so now let's go to that folder good folder, and i'm going to create right here views.", 'start': 18796.821, 'duration': 8.103}], 'summary': 'Discussing calling get products method and rendering form in product controller.', 'duration': 29.411, 'max_score': 18775.513, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/2eebptXfEvw/pics/2eebptXfEvw18775513.jpg'}, {'end': 18871.163, 'src': 'embed', 'start': 18839.404, 'weight': 0, 'content': [{'end': 18844.227, 'text': 'And we will need form as well, which will be reused for create and update.', 'start': 18839.404, 'duration': 4.823}, {'end': 18847.549, 'text': "So let's create underscore form.", 'start': 18844.707, 'duration': 2.842}, {'end': 18858.991, 'text': 'just like this one, and we will also need to create a layout, so we will need the header and footer to be written in a single place and use that.', 'start': 18848.71, 'duration': 10.281}, {'end': 18864.417, 'text': "But first let's implement the rendering of the form.", 'start': 18860.714, 'duration': 3.703}, {'end': 18871.163, 'text': "So I'm going to write in each of them, an H1 tag, create new product.", 'start': 18864.798, 'duration': 6.365}], 'summary': 'Creating reusable form for create and update with header and footer layout.', 'duration': 31.759, 'max_score': 18839.404, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/2eebptXfEvw/pics/2eebptXfEvw18839404.jpg'}, {'end': 20180.756, 'src': 'embed', 'start': 20148.917, 'weight': 4, 'content': [{'end': 20167.604, 'text': 'title equals from the super global post to take the title and repeat this for description as well and price and for image file as well.', 'start': 20148.917, 'duration': 18.687}, {'end': 20170.767, 'text': 'so image file, project data.', 'start': 20167.604, 'duration': 3.163}, {'end': 20180.756, 'text': "image file equals from the files super global to take out the image and if the image is not presented, let's take out the null.", 'start': 20170.767, 'duration': 9.989}], 'summary': 'Extract title, description, price, and image file from super global post and files, handling null images.', 'duration': 31.839, 'max_score': 20148.917, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/2eebptXfEvw/pics/2eebptXfEvw20148917.jpg'}, {'end': 20265.865, 'src': 'embed', 'start': 20235.257, 'weight': 3, 'content': [{'end': 20238.139, 'text': "so let's implement that save.", 'start': 20235.257, 'duration': 2.882}, {'end': 20252.017, 'text': "so for this let's go to the product and down below i'm going to create function save and let's declare an array of errors right here errors,", 'start': 20238.139, 'duration': 13.878}, {'end': 20254.118, 'text': "and let's do the validation.", 'start': 20252.017, 'duration': 2.101}, {'end': 20263.443, 'text': "so if this title doesn't exist, so we know that we loaded the data into these properties.", 'start': 20254.118, 'duration': 9.325}, {'end': 20265.865, 'text': 'okay, this title, this description and so on.', 'start': 20263.443, 'duration': 2.422}], 'summary': 'Implementing save function with data validation and error handling.', 'duration': 30.608, 'max_score': 20235.257, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/2eebptXfEvw/pics/2eebptXfEvw20235257.jpg'}], 'start': 18515.286, 'title': 'Php mvc framework, product list view, form handling, and database mapping', 'summary': 'Covers creating a mini mvc framework, setting up database connection using pdo, rendering views, and implementing a layout. it also includes setting up the product list view, accessing products, resolving asset issues, and displaying 8 products. additionally, it covers form handling, model creation, mapping class to database table, and product class implementation.', 'chapters': [{'end': 19247.772, 'start': 18515.286, 'title': 'Creating mvc framework and database connection', 'summary': 'Discusses creating a mini mvc framework, setting up a database connection using pdo, rendering views, and implementing a layout to render content properly.', 'duration': 732.486, 'highlights': ['Setting up a database class with a constructor and PDO connection The speaker creates a database class with a constructor and uses PDO to establish a database connection.', 'Implementing a method to get products from the database The speaker creates a method to get products from the database using a select query and prepares the search keyword to return all products if no search argument is provided.', "Rendering views and implementing a layout for proper content display The speaker discusses rendering views using a 'render view' method, including output caching with ob_start and ob_get_clean to properly render content within a layout."]}, {'end': 19634.84, 'start': 19247.772, 'title': 'Setting up product list view', 'summary': 'Covers setting up the product list view, including creating an instance of the database, accessing products from the database, passing products to the view, and resolving issues with included assets and search functionality. the product list is successfully displayed with 8 products.', 'duration': 387.068, 'highlights': ['The database instance is created in the router using a constructor, establishing a connection to MySQL, and accessed in the product controller to retrieve all products, resulting in 8 products being displayed on the view.', 'The products are passed as an associative array to the view, configuring parameters to make them available inside the view and resolving issues with included assets such as images and CSS.', 'The search functionality is implemented by creating a search variable in the product controller, filtering products properly and passing the search as a param to the view.']}, {'end': 19908.919, 'start': 19634.84, 'title': 'Php development: form handling and model creation', 'summary': 'Covers implementing form handling and model creation in php development, including creating search variables, moving images, and handling form submission using if statements and namespaces.', 'duration': 274.079, 'highlights': ['Implementing form handling and model creation The chapter covers the implementation of form handling and model creation in PHP development.', 'Creating search variable and fixing errors The process involves creating a search variable and fixing errors to ensure proper functionality.', 'Moving images and implementing create, update, and delete functions The process includes moving images and implementing create, update, and delete functions in the PHP application.', 'Handling form submission using if statements and namespaces It covers the handling of form submission using if statements and namespaces to ensure proper data submission and organization.']}, {'end': 20180.756, 'start': 19908.919, 'title': 'Mapping class to database table', 'summary': 'Discusses mapping a class to a database table, defining properties as columns, allowing optional values, data loading function, and obtaining data in the product controller to assign to product properties.', 'duration': 271.837, 'highlights': ['Defining properties as columns in the database with optional values using question mark, such as integer ID, string title, description, image path, and float price. The class defines properties like integer ID, string title, description, image path, and float price with optional values indicated by question marks.', "Creating a data loading function within the product class to assign data values to the class properties, handling optional values, and assuming null if data is not provided. A public function 'load' is created within the product class to assign data values to class properties, handling optional values and assuming null if data is not provided.", 'Obtaining data in the product controller from the post, assigning it to product properties, and creating an instance of the product. In the product controller, data is obtained from the post, assigned to product properties, and an instance of the product is created.']}, {'end': 20441.38, 'start': 20183.324, 'title': 'Product class implementation', 'summary': 'Covers the implementation of the product class, including loading product data, implementing save method with validation, and directory creation for image upload.', 'duration': 258.056, 'highlights': ['Implementing save method with validation The transcript details the process of implementing a save method in the product class, including validation for required fields such as title and price.', 'Creating directory for image upload The speaker explains the process of creating a public directory and modifying the path for image upload, ensuring the correct directory structure for the product model.', 'Loading product data and calling save method The chapter discusses loading product data into the product model and calling the save method, indicating the progression towards redirecting the user to the index page upon successful save.']}], 'duration': 1926.094, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/2eebptXfEvw/pics/2eebptXfEvw18515286.jpg', 'highlights': ['Setting up a database class with a constructor and PDO connection The speaker creates a database class with a constructor and uses PDO to establish a database connection.', 'The database instance is created in the router using a constructor, establishing a connection to MySQL, and accessed in the product controller to retrieve all products, resulting in 8 products being displayed on the view.', 'Implementing form handling and model creation The chapter covers the implementation of form handling and model creation in PHP development.', 'Defining properties as columns in the database with optional values using question mark, such as integer ID, string title, description, image path, and float price. The class defines properties like integer ID, string title, description, image path, and float price with optional values indicated by question marks.', 'Implementing save method with validation The transcript details the process of implementing a save method in the product class, including validation for required fields such as title and price.']}, {'end': 21726.586, 'segs': [{'end': 20530.009, 'src': 'embed', 'start': 20505.051, 'weight': 9, 'content': [{'end': 20510.713, 'text': 'typed property price must be float or null and string used.', 'start': 20505.051, 'duration': 5.662}, {'end': 20519.437, 'text': "that's obvious, because right here, from the product controller, everything basically taken out from that is string.", 'start': 20510.713, 'duration': 8.724}, {'end': 20526.207, 'text': 'so we can cast this into float float in this way.', 'start': 20519.437, 'duration': 6.77}, {'end': 20530.009, 'text': 'so save and refresh and here we have it.', 'start': 20526.207, 'duration': 3.802}], 'summary': 'Property price must be cast to float in the product controller.', 'duration': 24.958, 'max_score': 20505.051, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/2eebptXfEvw/pics/2eebptXfEvw20505051.jpg'}, {'end': 20903.079, 'src': 'embed', 'start': 20873.164, 'weight': 4, 'content': [{'end': 20887.132, 'text': "okay, looks good, and let's try one with image uploading, choose an image test6, test with some description, hit the enter and here we have a problem.", 'start': 20873.164, 'duration': 13.968}, {'end': 20889.753, 'text': "that's about calling a random string.", 'start': 20887.132, 'duration': 2.621}, {'end': 20903.079, 'text': "so we don't have that random string function and what we can do is that we can create that functions.php right here in the good folder and just require once,", 'start': 20889.753, 'duration': 13.326}], 'summary': 'Testing image uploading encountered a problem with a missing random string function.', 'duration': 29.915, 'max_score': 20873.164, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/2eebptXfEvw/pics/2eebptXfEvw20873164.jpg'}, {'end': 21145.238, 'src': 'embed', 'start': 21089.329, 'weight': 1, 'content': [{'end': 21094.991, 'text': 'that should delete the product and redirect user to the products list.', 'start': 21089.329, 'duration': 5.662}, {'end': 21099.333, 'text': "so let's have a look, refresh and let's delete a couple of others.", 'start': 21094.991, 'duration': 4.342}, {'end': 21100.873, 'text': 'and here we have the problem.', 'start': 21099.333, 'duration': 1.54}, {'end': 21104.034, 'text': 'so we just need to fix that.', 'start': 21100.873, 'duration': 3.161}, {'end': 21110.857, 'text': 'views products create, not the create, but we want index.', 'start': 21104.034, 'duration': 6.823}, {'end': 21114.718, 'text': 'so we just need to fix the path right here.', 'start': 21110.857, 'duration': 3.861}, {'end': 21125.961, 'text': 'so it should be submitted on slash products, slash delete right here, and we should pass that id as a hidden input.', 'start': 21114.718, 'duration': 11.243}, {'end': 21128.041, 'text': 'so that should work.', 'start': 21125.961, 'duration': 2.08}, {'end': 21134.262, 'text': "let's go back and refresh and just click on the test product.", 'start': 21128.041, 'duration': 6.221}, {'end': 21138.043, 'text': 'okay, it was successfully deleted.', 'start': 21134.262, 'duration': 3.781}, {'end': 21138.923, 'text': 'okay, perfect.', 'start': 21138.043, 'duration': 0.88}, {'end': 21141.804, 'text': 'and we need to fix right now the update.', 'start': 21138.923, 'duration': 2.881}, {'end': 21145.238, 'text': 'so slash products, slash update.', 'start': 21141.804, 'duration': 3.434}], 'summary': 'Fix path for product deletion and update in views. successfully deleted test product.', 'duration': 55.909, 'max_score': 21089.329, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/2eebptXfEvw/pics/2eebptXfEvw21089329.jpg'}, {'end': 21255.317, 'src': 'embed', 'start': 21175.006, 'weight': 0, 'content': [{'end': 21183.495, 'text': 'router, that should be a router variable and we get right here an id from super global.', 'start': 21175.006, 'duration': 8.489}, {'end': 21192.864, 'text': "get if that id doesn't exist, we take null if the id exists.", 'start': 21183.495, 'duration': 9.369}, {'end': 21199.612, 'text': "more specifically, if the id doesn't exist, we redirect user to the products page.", 'start': 21192.864, 'duration': 6.748}, {'end': 21201.234, 'text': "let's do this.", 'start': 21199.612, 'duration': 1.622}, {'end': 21208.504, 'text': 'however, if the id exists, we either need to render or we need to update.', 'start': 21201.234, 'duration': 7.27}, {'end': 21221.809, 'text': 'okay, so first of all we need to select so the product product data equals router db.', 'start': 21208.504, 'duration': 13.305}, {'end': 21226.91, 'text': "get product by id which doesn't exist yet.", 'start': 21221.809, 'duration': 5.101}, {'end': 21228.931, 'text': 'so we have to create that.', 'start': 21226.91, 'duration': 2.021}, {'end': 21232.992, 'text': 'so when we create, we can already render the view.', 'start': 21228.931, 'duration': 4.061}, {'end': 21238.973, 'text': 'router. uh, render render view.', 'start': 21233.852, 'duration': 5.121}, {'end': 21251.236, 'text': 'pass their products, slash, update and pass right there product to be product product data.', 'start': 21238.973, 'duration': 12.263}, {'end': 21253.176, 'text': "so let's implement that.", 'start': 21251.236, 'duration': 1.94}, {'end': 21255.317, 'text': 'get product by id in the database.', 'start': 21253.176, 'duration': 2.141}], 'summary': 'Using router variable, checks if id exists, redirects if not, renders or updates if yes.', 'duration': 80.311, 'max_score': 21175.006, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/2eebptXfEvw/pics/2eebptXfEvw21175006.jpg'}, {'end': 21338.816, 'src': 'embed', 'start': 21301.099, 'weight': 10, 'content': [{'end': 21304.822, 'text': 'so this looks good.', 'start': 21301.099, 'duration': 3.723}, {'end': 21315.859, 'text': "Now let's actually open that form update right here, and we just need to include the form, just like we are doing.", 'start': 21305.976, 'duration': 9.883}, {'end': 21320.721, 'text': "But we're doing this in the Create PHP, so that form should move inside the form.", 'start': 21316.22, 'duration': 4.501}, {'end': 21336.714, 'text': "so right here i'm going to put that form and i'm going to include that form right here and i'm going to do the same thing in the update,", 'start': 21323.562, 'duration': 13.152}, {'end': 21338.816, 'text': 'because we need the same form.', 'start': 21336.714, 'duration': 2.102}], 'summary': 'Discussing including a form in create and update php, for better functionality.', 'duration': 37.717, 'max_score': 21301.099, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/2eebptXfEvw/pics/2eebptXfEvw21301099.jpg'}, {'end': 21435.497, 'src': 'embed', 'start': 21401.626, 'weight': 5, 'content': [{'end': 21410.949, 'text': "So let's click the edit and Whenever we change something, the form will be submitted in the product controller and that should be the place.", 'start': 21401.626, 'duration': 9.323}, {'end': 21412.73, 'text': "so right here I'm going to write.", 'start': 21410.949, 'duration': 1.781}, {'end': 21431.336, 'text': 'if the server request method will be Post, what we need to do is that just populate title, description, price and image file inside the product data,', 'start': 21412.73, 'duration': 18.606}, {'end': 21433.697, 'text': 'so that should be product.', 'start': 21431.336, 'duration': 2.361}, {'end': 21435.497, 'text': 'excuse me, that should be title.', 'start': 21433.697, 'duration': 1.8}], 'summary': 'Form submission in product controller, populating title, description, price, and image file.', 'duration': 33.871, 'max_score': 21401.626, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/2eebptXfEvw/pics/2eebptXfEvw21401626.jpg'}, {'end': 21664.244, 'src': 'embed', 'start': 21631.526, 'weight': 11, 'content': [{'end': 21639.488, 'text': "the most logic is inside the form and inside the index.php, but that's just a table in a form, nothing else.", 'start': 21631.526, 'duration': 7.962}, {'end': 21651.074, 'text': 'but the big advantage is that so we splitted that logic across multiple files and we have a like the single responsibility principle,', 'start': 21639.488, 'duration': 11.586}, {'end': 21664.244, 'text': 'which means that the database class right here is responsible to set up a connection to the database and update product or delete the product or create the product and the product PHP itself.', 'start': 21651.074, 'duration': 13.17}], 'summary': 'Splitting logic across files adheres to single responsibility principle, enabling database class to handle connection and product operations.', 'duration': 32.718, 'max_score': 21631.526, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/2eebptXfEvw/pics/2eebptXfEvw21631526.jpg'}], 'start': 20441.38, 'title': 'Php product update', 'summary': 'Covers php product update implementation, including error handling, database update, and mvc structure, resulting in an advanced and improved application. it also discusses product validation, database implementation, image upload, and product management.', 'chapters': [{'end': 20505.051, 'start': 20441.38, 'title': 'Return errors from save', 'summary': 'Explains the process of returning errors from the save function in the controller, enabling redirection or error rendering based on the presence of errors, ultimately improving user experience and functionality.', 'duration': 63.671, 'highlights': ['The save function can now return errors, allowing for improved error handling and user feedback.', 'By checking if errors are empty, the system can determine if the save operation was successful or if errors need to be rendered for the user.', 'Displaying errors in the render view enhances user experience and facilitates error identification and resolution.']}, {'end': 20873.164, 'start': 20505.051, 'title': 'Product validation and database implementation', 'summary': 'Covers implementing product validation, processing user input, and saving product data in the database. it also discusses accessing the database instance through a singleton object and handling product image display based on its existence.', 'duration': 368.113, 'highlights': ['Implementing product validation and processing user input The speaker demonstrates how to handle product validation for required fields like title and price and processes user input to populate and display the product data.', "Saving product data in the database The speaker discusses implementing the 'create product' method to save product data in the database, including product title, image path, description, and price.", 'Accessing the database instance through a singleton object The speaker explains the concept of a singleton object and demonstrates accessing the database instance through a static property to handle database operations.', 'Handling product image display based on its existence The speaker troubleshoots and implements conditional logic to display the product image tag only if the image exists, ensuring proper image display on the product page.']}, {'end': 21255.317, 'start': 20873.164, 'title': 'Image upload and product management', 'summary': 'Discusses creating a random string function for image uploading, implementing delete and update functionality for products, and rendering the update view based on product data.', 'duration': 382.153, 'highlights': ["Creating a static function 'random string' for image uploading The speaker discusses creating a static function 'random string' in a utility helper class to generate a random string for image uploading.", 'Implementing delete functionality for products The speaker explains the process of implementing delete functionality for products, including accessing the database, accepting the product id, and redirecting the user after deletion.', "Rendering the update view based on product data The speaker outlines the process of rendering the update view by accessing product data using the 'get product by id' function and passing it to the update view for rendering."]}, {'end': 21726.586, 'start': 21256.537, 'title': 'Php product update implementation', 'summary': 'Demonstrates the implementation of a php product update feature, including form inclusion, error handling, database update, and mvc structure, resulting in a more advanced and improved application.', 'duration': 470.049, 'highlights': ['Implemented PHP product update feature, including form inclusion, error handling, and database update, contributing to a more advanced application.', 'Highlighted the MVC structure, with separate responsibilities for the database class, model, and controller, resulting in a more organized and improved application.', 'Described the benefits of the implemented MVC structure, emphasizing its minimalistic but effective approach and comparing it to previous versions for improvement.', 'Outlined the specific responsibilities of the database class, model, and controller in the MVC structure, contributing to a more organized and efficient application.']}], 'duration': 1285.206, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/2eebptXfEvw/pics/2eebptXfEvw20441380.jpg', 'highlights': ['The save function can now return errors, allowing for improved error handling and user feedback.', 'By checking if errors are empty, the system can determine if the save operation was successful or if errors need to be rendered for the user.', 'Displaying errors in the render view enhances user experience and facilitates error identification and resolution.', 'Implemented PHP product update feature, including form inclusion, error handling, and database update, contributing to a more advanced application.', 'Highlighted the MVC structure, with separate responsibilities for the database class, model, and controller, resulting in a more organized and improved application.', 'Described the benefits of the implemented MVC structure, emphasizing its minimalistic but effective approach and comparing it to previous versions for improvement.', 'Outlined the specific responsibilities of the database class, model, and controller in the MVC structure, contributing to a more organized and efficient application.', 'Implementing product validation and processing user input The speaker demonstrates how to handle product validation for required fields like title and price and processes user input to populate and display the product data.', "Saving product data in the database The speaker discusses implementing the 'create product' method to save product data in the database, including product title, image path, description, and price.", 'Accessing the database instance through a singleton object The speaker explains the concept of a singleton object and demonstrates accessing the database instance through a static property to handle database operations.', 'Handling product image display based on its existence The speaker troubleshoots and implements conditional logic to display the product image tag only if the image exists, ensuring proper image display on the product page.', "Creating a static function 'random string' for image uploading The speaker discusses creating a static function 'random string' in a utility helper class to generate a random string for image uploading.", 'Implementing delete functionality for products The speaker explains the process of implementing delete functionality for products, including accessing the database, accepting the product id, and redirecting the user after deletion.', "Rendering the update view based on product data The speaker outlines the process of rendering the update view by accessing product data using the 'get product by id' function and passing it to the update view for rendering."]}, {'end': 23239.513, 'segs': [{'end': 22624.898, 'src': 'embed', 'start': 22598.5, 'weight': 3, 'content': [{'end': 22603.481, 'text': "But if the pageCounter exists inside the session, let's leave whatever is there.", 'start': 22598.5, 'duration': 4.981}, {'end': 22608.582, 'text': "And after this, I'm going to increase the pageCounter by 1.", 'start': 22604.081, 'duration': 4.501}, {'end': 22618.471, 'text': "PageCounter++ So on the first visit this doesn't exist so 0 will be assigned to page counter and it will be increased and will become 1.", 'start': 22608.582, 'duration': 9.889}, {'end': 22624.898, 'text': 'On the next visit page counter will exist inside the session and it will be just increased.', 'start': 22618.471, 'duration': 6.427}], 'summary': 'Increment pagecounter by 1 on each visit.', 'duration': 26.398, 'max_score': 22598.5, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/2eebptXfEvw/pics/2eebptXfEvw22598500.jpg'}, {'end': 22997.51, 'src': 'embed', 'start': 22968.157, 'weight': 2, 'content': [{'end': 22974.66, 'text': 'so sessions are basically very often used with cookies and yeah, php session id is saved in the cookies.', 'start': 22968.157, 'duration': 6.503}, {'end': 22981.902, 'text': "okay, let's see how we can create values in cookies or delete or update that values.", 'start': 22975.24, 'duration': 6.662}, {'end': 22989.764, 'text': 'so for this we have a function, setCookie, and that setCookie accepts couple of arguments right here.', 'start': 22981.902, 'duration': 7.862}, {'end': 22997.51, 'text': 'first argument is the name, so we can pass any string right here, some key, and the second argument is the value.', 'start': 22989.764, 'duration': 7.746}], 'summary': 'Sessions are often used with cookies in php, with setcookie function to create, update, or delete values.', 'duration': 29.353, 'max_score': 22968.157, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/2eebptXfEvw/pics/2eebptXfEvw22968157.jpg'}, {'end': 23157.439, 'src': 'embed', 'start': 23131.701, 'weight': 0, 'content': [{'end': 23136.983, 'text': 'so current time minus one, for example, which is the past time.', 'start': 23131.701, 'duration': 5.282}, {'end': 23146.166, 'text': "so if i just save this and refresh it, go to the application, we don't see that cookie value anymore and if i go in the network.", 'start': 23136.983, 'duration': 9.183}, {'end': 23157.439, 'text': 'right here we passed the cookie from in the request this was the cookie and in the response it deleted that cookie, the latest record.', 'start': 23147.126, 'duration': 10.313}], 'summary': 'Cookie value deleted from response, not visible in application.', 'duration': 25.738, 'max_score': 23131.701, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/2eebptXfEvw/pics/2eebptXfEvw23131701.jpg'}], 'start': 21726.586, 'title': 'Managing apache virtual hosts, url bug fixing, and session management', 'summary': 'Covers setting up apache virtual hosts for laravel applications, fixing a url bug in a crud application, and providing a comprehensive understanding of session management and cookie handling in php, including practical demonstrations and configurations.', 'chapters': [{'end': 21997.058, 'start': 21726.586, 'title': 'Setting up apache virtual host for laravel application', 'summary': 'Outlines the process of setting up an apache virtual host for a laravel application, involving creating and configuring the virtual host in the httpd-vhosts.conf file, specifying the document root and server name, enabling rewrite engine, and updating the hosts file to map the domain to the local ip address.', 'duration': 270.472, 'highlights': ['Creating and configuring Apache Virtual Host for Laravel application The chapter outlines the process of creating and configuring an Apache Virtual Host for a Laravel application, specifying the document root, server name, enabling rewrite engine, and updating the hosts file.', "Specifying the document root and server name The document root and server name are specified in the virtual host configuration, with the example provided for the 'products.test' domain.", 'Enabling rewrite engine and redirecting requests to index.php The rewrite engine is enabled to redirect requests to index.php for handling, ensuring that all requests not made for a file or directory are directed to index.php.', "Updating the hosts file to map the domain to the local IP address The hosts file is updated to map the 'products.test' domain to the local IP address 127.0.0.1, enabling the virtual host to work properly."]}, {'end': 22223.87, 'start': 22002.819, 'title': 'Fixing url bug in crud application', 'summary': 'Covers the debugging and fixing of a url bug in a crud application where the issue is identified in the router.php and solved by extracting the required url from the request uri.', 'duration': 221.051, 'highlights': ["The bug in the router.php file causes the application to malfunction when using apache's virtual host instead of php's built-in server.", 'To fix the bug, the current URL needs to be extracted from the request URI by taking the substring before the question mark, ensuring proper functionality.', 'Identifying the presence of query parameters in the request URI is integral to correctly extracting the required URL for the application to work without issues.']}, {'end': 22654.257, 'start': 22224.631, 'title': 'Session management and cookie handling', 'summary': 'Covers setting up apache virtual hosts, explaining the difference between sessions and cookies, and demonstrates how to start a session in php, utilize cookies, and implement a page counter to track user visits.', 'duration': 429.626, 'highlights': ['Demonstrating the difference between sessions and cookies Explains the distinction between sessions and cookies, highlighting that session data is stored on the server side, while cookie data is saved on the client side and passed with every request and response.', 'Implementing a page counter using session Illustrates the process of setting up a page counter using sessions, with the ability to track user visits and trigger actions based on the number of visits, such as presenting a gift after a certain number of visits.', "Starting a session in PHP and utilizing cookies Demonstrates the use of the 'session_start' function in PHP to initiate a session and explains how data can be saved in cookies using the superglobal variable '_SESSION', providing a practical example with the ability to set, remove, and unset values."]}, {'end': 22885.618, 'start': 22654.257, 'title': 'Session management and cookies', 'summary': 'Explains session management and cookies in php, highlighting the process of setting, unsetting, and destroying sessions, as well as the usage and purposes of cookies for personalization, session management, and tracking.', 'duration': 231.361, 'highlights': ["Sessions can be unset to remove all values but not destroy the session, allowing setting of new values, while session destroy makes it impossible to set values inside the session. Session unset removes all values from the session but doesn't destroy it, allowing the setting of new values, while session destroy makes it impossible to set values inside the session.", 'The process of managing session variables and the necessity to retrieve and save variables before calling unset to prevent the loss of session data. It is necessary to retrieve and save session variables before calling unset to prevent the loss of session data.', "Cookies are used mainly for personalization, session management, and tracking in today's web development. Cookies are used mainly for personalization, session management, and tracking in today's web development."]}, {'end': 23239.513, 'start': 22885.658, 'title': 'Understanding cookies and sessions', 'summary': 'Explains how cookies are used for personalized recommendations on websites, tracking user behavior via google analytics, and managing sessions with php, demonstrating the set, update, and delete operations of cookies.', 'duration': 353.855, 'highlights': ['The chapter explains how cookies are used for personalized recommendations on websites, tracking user behavior via Google Analytics, and managing sessions with PHP, demonstrating the set, update, and delete operations of cookies.', "Amazon utilizes cookies to suggest products based on users' browsing history, demonstrating the personalized experience achieved through cookies.", 'Google Analytics tracks user behavior, including page visits and button clicks, using cookies, exemplifying the role of cookies in user activity tracking.', 'The session management process, often used with cookies, involves the PHP session ID being stored in cookies, showcasing the integration of sessions and cookies.', "The 'setCookie' function is utilized to create, update, and delete cookie values, with the ability to specify expiration dates, providing practical examples of cookie manipulation.", 'The demonstration includes setting a cookie with an expiration time of 60 seconds, updating the cookie value, and deleting the cookie, showcasing practical cookie management operations.', 'The exchange of cookies between the client and server is illustrated, emphasizing that both can write cookies, and cookies can also be manipulated using JavaScript.', 'The process of removing a cookie is explained, highlighting the ability to specify a past time for deletion and demonstrating the removal of a specific cookie.', 'The chapter concludes by summarizing the various cookie operations, showcasing server-initiated setting, updating, and deleting of cookie values.', 'The demonstration concludes with the absence of cookies being passed or received after the deletion process, emphasizing the successful deletion of the specified cookie.']}], 'duration': 1512.927, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/2eebptXfEvw/pics/2eebptXfEvw21726586.jpg', 'highlights': ['Covers setting up Apache Virtual Host for Laravel application, specifying document root, server name, enabling rewrite engine, and updating hosts file.', "Fixing a URL bug in the router.php file causing application malfunction when using Apache's virtual host instead of PHP's built-in server.", 'Explains the difference between sessions and cookies, demonstrating setting up a page counter using sessions and utilizing cookies.', 'Managing session variables, retrieving and saving variables before calling unset to prevent loss of session data.', 'Cookies used for personalized recommendations, user behavior tracking via Google Analytics, and managing sessions with PHP.']}], 'highlights': ['The course covers setting up a working environment, working with variables, loops, EFL statements, functions, dates, file systems, sessions, cookies, and building a product CRUD application three times with increasing optimization and modern tools.', 'PHP is a versatile language suitable for building simple to complex websites, CRM systems, e-commerce systems, REST APIs, and various software for image, video, and audio manipulation, while being compatible with almost all databases including non-relational databases.', 'The spread operator is a better way to merge two arrays in PHP 7.4.', 'Demonstrates the use of sort() and rsort() functions to sort arrays in PHP, with clear examples and visual representation of the sorted and reversed order of arrays.', "The shorthand notation 'name ? name : 'join'' can be used for conditional assignment, providing a more concise alternative for conditional assignments.", 'Covers file reading, directory listing, writing content to files, fetching data from URLs, converting JSON data, and checking file and directory existence using PHP functions.', 'CURL is a tool that allows remote interaction with services and resources, offering advantages over FileGetContents, such as bypassing security policies and allowing the use of additional headers and post requests.', 'Creating a separate functions.php file to improve code reusability by moving the common function into it and including it in both update.php and create.php to avoid code repetition.', 'Using Composer for autoloading classes and custom routing is crucial for understanding code improvement and offers practical insights for building a better application.', 'Setting up Apache Virtual Host for Laravel application, specifying document root, server name, enabling rewrite engine, and updating hosts file.']}