Skip to main content
The 2025 Annual Developer Survey is live — take the Survey today!

PHP Collective

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

Pinned content

View all 3 collections

PHP admins have deemed these posts noteworthy.

Pinned
33 votes
8k 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
60 votes
5k 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
8 views

ziggy-js cannot retrieve the current route correcly while using the same route name for different HTTP methods in Laravel 12

I am new on PHP and currently i'm using Laravel 12 with InertiaJS and React, such toolkit allows me to use ziggy as a route helper and do things like: import { RouteList } from 'ziggy-js'; type Routes=...
1 vote
0 answers
22 views

How to extend WooCommerce get_price_html() to include a parameter for custom field based pricing?

I'm trying to extend the WooCommerce get_price_html to pull pricing from a custom field setup on products. The issue I'm facing though is that it seems the get_price_html function which I'm using in ...
0 votes
0 answers
29 views

GitLab Project Webhook URL "Invalid URL Given" (422), but Works as System Hook

I'm trying to add a project-level webhook in GitLab. The webhook URL is: http://172.30.15.171/api/gitlab/webhook/info?userid=599&projectid=9944 This is an internal VPN IP that is accessible from ...
0 votes
0 answers
20 views

How to create a repeater field and save it with WooCommerce Settings API?

I have created a repeater form in the WooCommerce settings (custom settings page). The form works great but I've come into an issue with how to save and load it back in with the WP Option. The ...
0 votes
0 answers
38 views

Using own Pages model as reference within another model does not work

Hello dear Stackoverflow community, i've meet following Scenario which appears to not work properly. I have an Model called Principal Inside the Model, i have the following property protected Pages|...

Looking for an extra challenge?

View all bountied questions

These questions have a bounty on them

0 votes
0 answers
74 views
+500

UPS REST API - Tracking vs Track by Reference

As long as I have the tracking number, the UPS Track API works great. I use it as described on the help page: const inquiryNumber = "my tracking number"; $query = array( "locale"...

Learn something new
These are the most recent articles in PHP Collective
1 vote
143 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
2 votes
678 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
9 votes
2k 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
60 votes
5k 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