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
+18
17.7k Members
+61
Contact

Pinned content

View all 3 collections

PHP admins have deemed these posts noteworthy.

Pinned
41 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

2 votes
0 answers
37 views

created_at (server time) is sometimes earlier than clicked_at (client time) — why?

I’m tracking button clicks on my website and storing both client-side click time and server-side insert time in my database. Frontend (JavaScript) I capture the click timestamp like this: clicked_at: ...
1 vote
0 answers
58 views

Laravel app handling redirects unexpectedly

I have two apps running on the same server behind a Webscale proxy (Apache). A Laravel 11 app works correctly, returning a proper 302 with session cookies. My new Laravel 12 app returns 200 OK with no ...
0 votes
0 answers
45 views

Laravel localization using session not applying globally (locale changes in session but app()->getLocale() stays unchanged)

I am trying to implement localization (English/Japanese) in a Laravel 12 project using session-based language switching. I have a route to switch language: Route::get('/lang/{locale}', function ($...
2 votes
0 answers
65 views

Error in react-webview: error loading page. Domain: undefined. Error code: 3. Description: SSL error: The certificate authority is not trusted

I can't open a website within a webview in React Native. I always get the following message. Note: the site has normal SSL, but the SSL error keeps appearing: error loading page. Domain: undefined. ...
0 votes
0 answers
142 views

PHP8.2 ignores local value of `output_buffering` and uses master

I want to set output_buffering=0 in a single directory. When I create a .user.ini file in that directory with output_buffering=0 , phpinfo() shows 0 for the the local value, and 4096 for the master, ...

Learn something new
These are the most recent articles in PHP Collective
4 votes
679 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