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
+288
11k Members
+102
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
7 views

How to create image courusel for product card on Catalog page Woocomerce Wordpress

I use WordPress and Woocomerce. I have created a Catalog page with a grid of product cards. My endpoint is to create a slider (carousel) of images instead of one featured image now. When I created the ...
0 votes
0 answers
9 views

Bootstrap Collapse on unordered list doesn't react on first click

I have created a filetree page on a website and added some bootstrap collapse stuff which basically does all I want. The list of files and folders is shown with all tree branches uncollapsed initially....
0 votes
0 answers
29 views

Livewire components or controllers

There are many questions like this, but none explain more than "use only Livewire components" or "use Livewire only for interactivity." Also, I cant find live code bases of real ...
-2 votes
0 answers
27 views

Fastest way to remove \r and \n characters in a string in PHP in 2024?

I need to replace a few characters ("\r" and "\n") in a string and need the fastest most efficient way to do so because this code will run on a large scale. I've searched and found ...
0 votes
0 answers
21 views

I get 401 unauthorized error after successful login in reactjs app with laravel & sanctum

I have created an app with React while using Laravel 10 as back-end (using Sanctum for auth). When I try to log in on first attempt I get "401: unauthorized" error, but on second attempt it ...

Looking for an extra challenge?

View all bountied questions

These questions have a bounty on them

0 votes
1 answer
39 views
+200

PHP webDav client gives ClientException: SSL certificate problem: unable to get local issuer certificate

I want to upload files to NextCloud via PHP on Windows 11. I do not know PHP much but I managed to install sabre/dav via composer Then I found on the internet simple code sample to list files. <?...
0 votes
0 answers
64 views
+50

How to set the first order status as a custom status for newly created orders from Woocommerce Rest API?

We use a platform called BaseLinker, which sends orders from other marketplaces to our WooCommerce store through Rest API. The problem is that initially the orders have a status of "Payment ...

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

How to trim &nbsp; (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