Skip to main content

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
7 votes
3 answers
643 views

Why I made it I wrote this script for one simple purpose: to Rickroll my friends. How it works This is the workflow: It fetches a .png frame from a PHP endpoint on a website I own. The frame number ...
Chip01's user avatar
  • 413
7 votes
4 answers
652 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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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

1
2 3 4 5
86