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
+321
10.9k Members
+121
Contact

Pinned content

View all 3 collections

PHP admins have deemed these posts noteworthy.

Pinned
23 votes
5k 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
44 votes
3k 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
12 views

I'm getting 401 Unauthorized when accessing protected routes using http only cookies in Laravel with axios

I'm working on a Laravel application with JWT authentication, and I'm trying to use http-only cookies for authentication. Despite setting the cookie correctly on login, I'm still receiving a 401 ...
-1 votes
0 answers
21 views

Symfony Backend with React Js Frontend

I Create a react js frontend, and a symfony 7 Backend using api Rest and axis ,first I test the connection between the back and the front it works ,but when I continue on developing the Backend and ...
-1 votes
0 answers
19 views

How to correctly save an apostrophe in WordPress Database?

When I tried to save the user input in the database, if the user uses an apostrophe ( ' ) then in the database it is saved with a slash ( / ) before the apostrophe. So for example if the user enters &...
0 votes
0 answers
20 views

Ensuring casts are applied before Laravel data constructor is called

I am attempting to make use of the laravel-data package from Spatie, in order to ensure a typed contract between different layers of my application. Unfortunately, I'm having trouble with casting ...
1 vote
0 answers
7 views

Laravel Livewire wire:modle and wire:click showing 404 on cpanel but works fine on localhost

Laravel livewire works perfectly on localhost but when deploy to cpanel; shared hosting, wire:click and wire:model, not working, for example I have a live data search implemented with livewire, but ...

Looking for an extra challenge?

View all bountied questions

These questions have a bounty on them

0 votes
0 answers
46 views
+50

How to correctly encode special characters when programmatically creating ACF Gutenberg-Blocks in Wordpress?

I am building an importer for a wordpress project and have to map blocks to other block types. Therefore, I have an abstract base Block-Class that looks like this: abstract class Block { abstract ...

Learn something new
These are the most recent articles in PHP Collective
4 votes
212 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
21 votes
56k 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
44 votes
3k 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