Skip to main content

PHP Collective

A collective where developers working with PHP can learn and connect about the open source scripting language.
1.5m Questions
+24
18.2k Members
+77
Contact

Pinned content

View all 3 collections

PHP admins have deemed these posts noteworthy.

Pinned
43 votes
10k views
Collection

Common Mistakes to Avoid in PHP

A list of real issues most beginners encounter when using PHP.
Sasha's user avatar
  • 101
Pinned
64 votes
7k views
2 minute read
How-to guide

Start learning PHP — Useful resources for beginners and advanced

Start learning PHP — Useful resources for beginners and advanced! If you're wondering where to start from learning the PHP language or needing some more knowledge to deep dive into the language, you ...
RB Projects's user avatar

Can you answer these questions?

View all unanswered questions

These questions still don't have an answer

0 votes
0 answers
32 views

VSC Format on save only works on PHP files

I have set Editor Format on Save to true. My PHP files reformat when I save them but my HTML, Javascript files do not. Do I have to use some other setting to get them to format on save?
-1 votes
0 answers
57 views

session_name() Cannot Change Session Name When Headers Already Sent

I am running PHPUnit test cases in a Yii2 application. The tests pass successfully on my local environment, but fail in the CI/CD pipeline with the following error: [yii\base\ErrorException] ...
0 votes
0 answers
60 views

HTTP 403 Forbidden on Flutter → PHP API (Hostinger Cloud Hosting)

Problem A Flutter app (Android + iOS) talks to a PHP backend hosted on Hostinger Cloud Startup (not shared). Random endpoints under /api/* return: HTTP/1.1 403 Forbidden Content-Type: text/html Body: ...
1 vote
0 answers
55 views

WordPress header UI break issues with the event calander and DIVI 5

I am facing a strange issue with Divi 5 + The Events Calendar on my WordPress site. Issue: The main event archive page /event/ breaks the Divi header UI/layout. Single event pages like /event/sample-...
-1 votes
0 answers
152 views

Laravel Eloquent relationship filtering: return only serialized items where fk_customer_id is not null

In my system, when a product is sold, the fk_customer_id column in the serializations table becomes NOT NULL. If the product is still in stock, fk_customer_id remains NULL. In the purchase return page,...

Learn something new
These are the most recent articles in PHP Collective
4 votes
736 views
9 minute read
How-to guide

Quick guide to Laravel package development

Contents Introduction Types of packages Characteristics of a package The Laravel package! Components of a Laravel package Example of a Laravel package Creating your Laravel package 1- Package ...
Yousha Aleayoub's user avatar
3 votes
1k views
2 minute read
How-to guide

Properly removing API from Laravel project

Sometimes a development team may decide to remove all API functionality from a Laravel project for various reasons, such as: No longer needing any API, and shifting focus to web application with ...
Yousha Aleayoub's user avatar
13 votes
3k views
1 minute read
How-to guide

How to trim   (or non-breaking space) in PHP?

The main problem is the way trim() function works. One cannot reliably trim a substring using this function, because it takes its second argument as a collection of characters, each of which would be ...
Your Common Sense's user avatar
25 votes
57k views
3 minute read
Knowledge article

Evolution of Type Declarations in PHP

Introduction: PHP, being a dynamically typed language, traditionally allowed flexibility in variable types, providing both advantages and challenges in code maintenance and robustness. However, with ...
alkhatibdev's user avatar
64 votes
7k views
2 minute read
How-to guide

Start learning PHP — Useful resources for beginners and advanced

Start learning PHP — Useful resources for beginners and advanced! If you're wondering where to start from learning the PHP language or needing some more knowledge to deep dive into the language, you ...
RB Projects's user avatar