Using trim() for input sanitization, htmlspecialchars() for security, and __call() for dynamic method handling Through the last 100 PHP articles, we’ve used all sorts of built in functions. It’s time to collect them in one place, give a couple of examples, and add any additional ones that I might have missed. You may be asking what a built in function is. It’s just a function that comes with the PHP installation. You don’t have to know where they’re at. You don’t have to instantiate an object. They’re available globally. The functions that we’re going to look at are the following:
Tag: Carbon
Popular PHP library for working with dates and times The 100th post on PHP. Wow. Okay, enough patting myself on the back. Let’s get to Carbon. What is Carbon? Remember when we covered the DateTime object? It was post 98. Well, Carbon is a PHP dependency that extends the DateTime class. It has a lot more simplified interface and is extremely simple to use. https://blog.devgenius.io/php-p98-datetime-object-1191e4b457c1 https://blog.devgenius.io/php-p99-dependency-management-intro-fe42877964d4 Installing the Carbon Dependency Before you can install Carbon, you’ll need to make sure that you have composer installed. Composer is a dependency manager and was the topic of the last article. Once you have composer installed, run the following command. composer require nesbot/carbon