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
+222
+1
11.8k Members
+115
Contact

Pinned content

View all 3 collections

PHP admins have deemed these posts noteworthy.

Pinned
26 votes
6k 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
49 votes
4k 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
3 views

PHP code issue causing grid container and bootstrap 5 cards (grid-items) not to render on web-page loading?

I am trying to create a grid container that will dynamically display bootstrap cards of treeseed items that I added to MySQL database.The items should be displayed on the shop portion of a webpage I ...
0 votes
0 answers
7 views

Has anyone successfully managed to configure a PHP class method to retrieve a CheckoutId for a Sumup Payment Widget

Our HTML/Javascript client sends a request to our PHP proxy Class and method to invoke the communication with the Sumup API. The Sumup Developer Documentation appears to require three steps: Use Curl ...
0 votes
0 answers
16 views

PHP exec() command not working as expected

I have a PHP process (backup-generic) that builds and then executes a command to perform backups on various directories. The net result of this command, when I execute for a particular user's home ...
0 votes
0 answers
7 views

Exclude products with specific metadata from WooCommerce recent products widget

I am currently trying to exclude specific products from the WooCommerce recent products widget. Specifically, I want to prevent products with specific metadata from being displayed: Meta key ...
0 votes
0 answers
8 views

Laravel Socialite Google OAuth with Sanctum: Session created but user_id is null after login

I'm building an API-only SPA with Laravel Sanctum and Nuxt3, using cookie-based session authentication. I’ve implemented Google OAuth using Laravel Socialite. Here’s my current setup for the Google ...

Looking for an extra challenge?

View all bountied questions

These questions have a bounty on them

-1 votes
1 answer
49 views
+100

Laravel 11 Artisan lang:publish generates empty lang folder

Following the documentation, I tried to run php artisan lang:publish but it generates an empty lang folder. I would expect there will be at least messages.php file for English. Can somebody tell me ...
-1 votes
0 answers
72 views
+250

How can I post via API to a Facebook Page without having my "Facebook App" suspended/deleted?

How can I post via API to a Facebook Page without having my "Facebook App" suspended/deleted? I need to share a URLs per day, via API, from my own script to a Facebook Page I manage. I ...

Learn something new
These are the most recent articles in PHP Collective
1 vote
16 views
2 minute read
Knowledge article

Understanding the final Keyword in PHP: Preventing Inheritance and Overriding

Introduction When working with Object-Oriented Programming (OOP) in PHP, controlling the inheritance of classes and methods is essential for maintaining stability and security in your code. PHP ...
Al Amin's user avatar
  • 120
8 votes
662 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
22 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
49 votes
4k 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