PHP Stream Wrappers are one of the most underrated features in the language.

πŸ“Œ Local file?
πŸ“Œ HTTPS?
πŸ“Œ Inside a ZIP?
β†’ Same function. Only the URL changes.

πŸ”— LINK : https://jewelhuq.medium.com/mastering-php-stream-wrappers-a-practical-guide-with-a-dev-story-5ad510fa78dd

#PHP #Coding #Backend #WebDev #PHPTips

You’ve probably seen `use function strlen` in PHP and shrugged.

But here’s the twist: in certain cases, it activates a special compiler optimization in PHP that makes some functions significantly faster.

This is your eureka moment! Here’s how it works, when it matters, and how to adopt it easily: https://tideways.com/profiler/blog/compiler-optimized-php-functions?utm_medium=social&utm_source=mastodon&utm_campaign=compiler-optimized-php-functions

#php #opcache #compileroptimization #phptips #webdev #coding #programming #performance

Send a Slack notification from a web interface using PHP?

With Temma, it only takes a few lines of code.

πŸ‘‰ Full tutorial here:
https://www.temma.net/en/tuto/mini-web2slack

#PHP #Temma #SlackIntegration #WebDev #PHPTips #OpenSource #CleanCode

Learn how to set up a custom BelongsTo relationship in Laravel Nova! Perfect for developers working with legacy databases or needing user-friendly admin panels. #LaravelNova #WebDevelopment #PHPTips
https://stevenroland.com/posts/setting-up-a-custom-belongsto-relationship-in-laravel-nova
Setting Up a Custom BelongsTo Relationship in Laravel Nova

Learn to set up a customized BelongsTo field in Laravel Nova. Create an intuitive admin interface effortlessly!

Steven Roland
An update; using the second parameter of count() does not work with objects that have the Countable interface. That is by design, the second parameter is only supported with arrays. If you have an object that supports Countable you can use iterator_count() instead but that does mean it needs to be Traversable as well. Fun! #PHPTips