Skip to main content
We’ve updated our Terms of Service. A new AI Addendum clarifies how Stack Overflow utilizes AI interactions.

Questions tagged [php]

PHP is a widely-used, general-purpose scripting language that is especially suited for web development.

Filter by
Sorted by
Tagged with
2 votes
1 answer
112 views

I have made a Laravel 8 blogging application that supports themes. I had made a custom 404 template for every theme, the path to it being ...
Razvan Zamfir's user avatar
7 votes
4 answers
651 views

I'm a hobby coder at best. I know enough to make helpful programs to assist me with day to day life and work (mostly with PHP/JS, some C#). I'm wanting to learn more about good coding practices. I ...
Aethar's user avatar
  • 71
3 votes
2 answers
162 views

I’ve built a backend-only wallet service using Laravel 8, and it’s fully containerized with Docker. The project handles two user roles (Players and Backoffice Agents) and provides JWT-based ...
Şirin Berhuş's user avatar
2 votes
1 answer
89 views

I’m working with a MySQL database that models product compositions and raw materials. There are two relevant tables with columns as shown: product_recipes: ...
Boom's user avatar
  • 121
5 votes
2 answers
244 views

I’m developing a Laravel app which acts as a client to consume a 3rd party Strava API. My app also functions as an API for a frontend SPA. The user (which is just me for the time being) will already ...
ah5's user avatar
  • 51
3 votes
1 answer
186 views

I have a master page, where I need to render data from multiple models. I have made a prototype of that page to show only the required conditions. What is the best approach for controller to retrieve ...
nischalinn's user avatar
6 votes
3 answers
550 views

I have created following php PDO wrapper class with the help of google and other some websites and my little knowledge. I will use this for less coding work without change whole previous coded ...
Sing O Song's user avatar
3 votes
1 answer
236 views

I am working on a blogging application in Laravel 8. I have put together a way to preview and remove the main article image. In the ArticleController.php controller,...
Razvan Zamfir's user avatar
3 votes
1 answer
99 views

When MySQL executes a Data Modification Query, it provides some additional info on the outcome, which is usually displayed in the console. This info is also being exposed through MySQL C API and this ...
Your Common Sense's user avatar
2 votes
2 answers
183 views

I have a dictionary with a lot of symbols, each of which is encoded in a huffman binary string. Example: Symbol Huffman Code you 010 shall 0111 not 00111 pass 00001 ... ... Therefore I encode the ...
Benzio's user avatar
  • 131
3 votes
1 answer
71 views

I wrote this PHP script to dynamically generate a topic header layout using CSS grid. The $columns array defines each column’s properties—like its CSS class, size, ...
live627's user avatar
  • 131
4 votes
2 answers
499 views

I am working on an in-house application, and I am working on how our application communicates with our remote server. I have a PHP script that acts as an API to call to our MySQL DB and dump its ...
Cory Green's user avatar
3 votes
1 answer
69 views

I work on plugin for custom auth pages for WordPress and I try to create a custom registration form with additional fields. it has a shortcode in Beaver Builder. Is this the correct approach, and ...
Pavel Drow's user avatar
4 votes
1 answer
176 views

In Drupal 11 or greater, this code is used to change the node type of a node. How would you improve the code if at all? ...
the_humble_asker's user avatar
5 votes
1 answer
559 views

I got as task to build a simple Laravel API that should: 1 - Create User API 2 - Get Users API So I run the artisan command to ...
oderfla's user avatar
  • 235
2 votes
0 answers
56 views

I am currently learning Symfony UX. My focus today was on UX Turbo. I basically wanted to create a very basic Single Page Application. User can 'login' using a form, submitting the form should render ...
O'Niel's user avatar
  • 351
4 votes
1 answer
166 views

I am making a base test class that bootstraps database Test cases ...
Dimitrios Desyllas's user avatar
4 votes
3 answers
1k views

When PHP converts a number to string (for printing it out, for example), sometimes it may convert it to scientific notation out of nowhere (0.000021 for example). Or the number can be already in a ...
Your Common Sense's user avatar
0 votes
0 answers
52 views

I am implementing a system in which a client fills a form. Each form has multiple sections and each section populates multiple tables, thus user fills each section separately. I was asked to make a ...
Dimitrios Desyllas's user avatar
3 votes
1 answer
89 views

I need to round a decimal to the nearest 50's (please correct this phrase because I am not sure how it's called in English) For example: ...
pileup's user avatar
  • 461
3 votes
2 answers
130 views

This is my first time using FCM, and I had a lot of trouble finding up to date examples on how to send notifications using Firebase Cloud Messaging Notifications via FCM HTTP v1 API with PHP. I'd ...
tony's user avatar
  • 433
4 votes
4 answers
239 views

I got this task to evaluate my knowledges in PHP. I was asked to avoid using functions like strrev() or array_reverse(). ...
user avatar
2 votes
0 answers
62 views

I want to unit test my PHP website, which uses the outdated framework CodeIgniter 3. CodeIgniter 3 uses the MVC pattern, and each page on the website corresponds to a public method in a controller. I ...
RedDragonWebDesign's user avatar
3 votes
1 answer
209 views

I am making a class in PHP that detects the social network or instant messaging platform of a given URL: ...
Dimitrios Desyllas's user avatar
2 votes
0 answers
106 views

So few days ago, I had created another review request for sqlite database schema for a comment hosting system. Now that the app development is complete, I have pushed the initial version on github. As ...
Prahlad Yeri's user avatar
3 votes
1 answer
58 views

I’ve recently developed an open-source PHP package called Disposable Email Filter and would greatly appreciate a thorough code review. The purpose of this package is to filter out disposable email ...
sint's user avatar
  • 31
2 votes
0 answers
130 views

I have implemented a custom WooCommerce checkout field to collect a Tax Exempt Number in the billing section. This field's value is stored in the user meta upon checkout to facilitate future orders. ...
intothevoid0's user avatar
2 votes
1 answer
194 views

The challenge Given array a of n numbers, I need to count how many positive numbers less than each aᵢ have exactly 3 divisors. Constraints 1 <= aᵢ <= 2.5 * 10¹³ In other words, the minimum ...
Muhammad Usman's user avatar
4 votes
1 answer
152 views

I am working on a project that involves tracking the operating hours of businesses across different timezones. Some of these businesses operate past midnight, and to accommodate this, operating hours ...
tony's user avatar
  • 433
6 votes
3 answers
309 views

I wrote a simplified VarDumper and wanted to get feedback on areas I can improve on my code. My biggest area of concern is the captureContext method making sure I get the correct file and line ...
CodeWithPhpX's user avatar
4 votes
1 answer
459 views

I am writing a simple PHP script to display all my available stores in google map. If the user just came in, I need to set the user current city as default city using geolocation (3rd party); ...
Cooperative's user avatar
2 votes
1 answer
161 views

I made a simple script that notifies a Telegram Channel when a new youtube video is uploaded upon a YouTube channel: index.php ...
Dimitrios Desyllas's user avatar
4 votes
1 answer
239 views

The frontend has a table with hundreds of rows. Each row consists of different inputs (text, file, ...
pileup's user avatar
  • 461
3 votes
2 answers
266 views

I have created two pages (one straight HTML, the other PHP) to show an HTML file in the context of my server. The reason for this is simply to get access to / the styles in the CSS spreadsheets - not ...
ControlAltDel's user avatar
2 votes
0 answers
177 views

I am working on a PHP application that transforms data from the input CSV (JSON, TXT, or XML) into an output CSV (JSON or database, for example). The output format differs from the input: some columns ...
friday-json's user avatar
2 votes
1 answer
76 views

we are trying to justify a long text into a image and we need to justify it. We have solved the problem with this function, but it's too heavy and takes a long time to process the text justification. ...
Picture with words's user avatar
3 votes
4 answers
783 views

In my case I am saving a URL into my database via Eloquent Model: ...
Dimitrios Desyllas's user avatar
2 votes
2 answers
116 views

I have a legacy PHP project using a self-styled configuration file (named globals.inc.php) which is generated by build scripts based on a template included in the ...
JoSSte's user avatar
  • 199
1 vote
2 answers
251 views

I've been working on a WordPress pricing page template and would appreciate feedback on the code structure, organization, and any potential improvements. The template is used to display a pricing list ...
KermitTheFrog's user avatar
8 votes
3 answers
1k views

I wrote a simple PHP login form for a website. It has an initialization script, as well as a form to allow a user to login, plus a link to log the user out after logging in. ...
whiteman808's user avatar
2 votes
1 answer
85 views

previusly I make a post for Session Logic for User Verification in Rails Migration. Now the improvement version following advice of the comments is here. The problem was the use of `` for executing in ...
ZAMA's user avatar
  • 55
3 votes
1 answer
115 views

This is a logic to create sessions on RoR 7.1.2 based on the last version of the website which was in vanilla PHP, with the upgrade I have to deal with the users that were already signed up but not ...
ZAMA's user avatar
  • 55
2 votes
0 answers
209 views

I've got an open-source project that I've been working on for a while, and I'm looking for advice on handling large classes. It's a Laravel 10+ package for building forms, and everything works fine, ...
Second2None's user avatar
5 votes
2 answers
310 views

I'm a CS undergrad, so I don't have much experience. But while coding vanilla PHP projects, I found that I was repeating myself a lot with the CRUD operations. So overtime, I developed a single file ...
sammy medawar's user avatar
5 votes
3 answers
1k views

/.htaccess ErrorDocument 404 /inc/index.php ErrorDocument 500 /inc/index.php RewriteEngine ON RewriteRule ^([a-z_-]+)$ index.php?page=$1 [L] /index.php ...
Nathan George's user avatar
2 votes
1 answer
109 views

I am currently working on integrating PayPal with my Laravel application, and it's my first time incorporating PayPal for production use. I have written the following code and would greatly appreciate ...
titac projets's user avatar
4 votes
2 answers
166 views

I'm a newbie to PHP and other programming for that matter. I'm doing this simply to learn. Figured the code could be used to search through a police database or something. The statements are Microsoft ...
Luke Lenacio's user avatar
3 votes
1 answer
124 views

This is my Laravel seeder for two database tables. I need to make this seeder more efficient and optimized. How can this be achieved? I would appreciate some tips. ...
Tarikul's user avatar
  • 31
4 votes
2 answers
255 views

I'm looking for pointers on the best way to optimize my code below. The query is designed to pull for a vendor database in a separate SQL server table that I built a connection to in my wordpress site....
Mike Mann's user avatar
  • 141
4 votes
1 answer
170 views

I implemented a CSV Parser with Separation of concerns and SOLID principles in mind. Does that code match the principles? Here a sample data (CSV): ...
friday-json's user avatar

1
2 3 4 5
86