4

Newest 'php' Questions - Code Review Stack Exchange

 2 years ago
source link: https://codereview.stackexchange.com/questions/tagged/php
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

Questions tagged [php]

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

Filter by
No answers
No accepted answer
Has bounty
Sorted by
Newest
Recent activity
Highest score
Most frequent
Bounty ending soon
Tagged with
My watched tags
The following tags:
4 votes
2 answers
179 views

Functions in PHP to run basic MySQL crud

I wrote a list of functions in PHP that I want to use in my pet project as an autoloaded file for all parts of the app. The purpose of these function is to shorten the code you write for MySQL queries ...
3 votes
1 answer
130 views

Generating responsive image html with php?

As a beginner in php, I welcome you feedback on improving or simplifying the following php code that generates this responsive image html (image sizes and formats are auto-generated using Gulp). For ...
1 vote
0 answers
91 views

Applying the Strategy pattern for payment methods

The strategy pattern is applied in the code below in the payment separation solution. Please evaluate if it is well done according to standards. I would be very grateful for suggestions. ...
0 votes
0 answers
36 views

file MIME check on update form

I'm a very beginner. I developed this today and it's working (YAY) but I would like to make sure ALL of my checkFile($file) method's conditions are fully used and ...
1 vote
0 answers
38 views

Error handling for Laravel REST API client and server using bearer token authentication

I would like to query a REST API (which uses Bearer token authentication), handling several exceptions that might occur. Could you tell me if the following code (which I explain later in this post) is ...
4 votes
3 answers
767 views

Filter an array, but remove the filtered elements

I needed a PHP function that would filter values from one array into a new one, while also removing those values from the original array. After looking through the docs, I didn't see any such function,...
0 votes
0 answers
43 views

How to optimize a search between dates in a WP Query?

In the posts I have a date field and a start and end date range. I need to query if it matches date or if it matches between the dates in the range. This Query works, but how can I optimize? ...
1 vote
1 answer
96 views

Wrap INSERT statements to PDO transaction (PHP OOP)

so Im trying to wrap SQL INSERT statements to PDO transaction in PHP OOP. I don't know if I'm doing it right and this is the best/easiest way to do it. So what is important for me is: There can be ...

asked Jul 10 at 14:46

-1 votes
2 answers
145 views

Product list from database to web tables/boxes

I am a self-taught front-end developer, trying to land a job, the PHP and MySQL are quite new to me, since I only watched and did some code through Traversy Media courses. This is a test project, ...
1 vote
2 answers
65 views

Check if a new movie session can be inserted

I have this function in my code, this way I validate if a new movie session can be inserted, it works, but I wanted to find a better way to do it. ...

asked Jun 30 at 21:07

1 vote
1 answer
86 views

Is this PDO query okay to use in PHP OOP?

Do you think this code is good if I want to do a simple SQL query? Is it safe to use? Or am I doing something wrong? ...

asked Jun 30 at 17:41

0 votes
1 answer
46 views

Simple websocket chat app, security and efficiency concerns

I'm coding a simple websocket chat app. I was wondering if my code is secure and efficient. I also have a question about the way how I'm sending objects and then checking the type, is there anything ...
5 votes
2 answers
589 views

Count each word within a string

I am looking for a solution with fewer lines of code. This is code that is working perfectly, but I think I typed too much for this algorithm. If I did something wrong, feel free to tell me the error. ...
7 votes
2 answers
174 views

OOP PHP form builder with validation

Yes, another PHP form builder... I wrote this solely to demonstrate OOP principles. My questions are:

Could this be written better? OOP-wise. How could I better implement error handling?

Index.php <...

0 votes
1 answer
65 views

PHP assign values within in_array

What is a more efficient way of writing this sample code? Its purpose is to create a variable for days of the week based on a numerical value. This data is obtained from user input checkboxes. If the ...

asked Jun 13 at 5:36


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK