Questions tagged [php]
PHP is a widely-used, general-purpose scripting language that is especially suited for web development.
4,262 questions
1vote
2answers
148views
Convert binary string to text base64 [closed]
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 ...
3votes
1answer
46views
PHP script to generate named CSS grid areas
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, ...
4votes
2answers
464views
Improving upon the Security of my Export Remote Database to Local PHP API
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 ...
3votes
1answer
54views
Wordpress custom registration form with additional fields
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 ...
4votes
1answer
144views
Replace node type in Drupal
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? ...
5votes
1answer
543views
User Management API
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 ...
3votes
0answers
44views
SPA in Symfony UX Turbo
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 ...
4votes
1answer
130views
Creating Dedicated Database for database test cases (Tests that I need to check the data are written or read sucessfully) in phpunit
I am making a base test class that bootstraps database Test cases ...
4votes
3answers
1kviews
A function to convert numbers from scientific notation to plain decimal
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 ...
1vote
0answers
41views
Securely send data as a parameter in a Livewire action method
I have friendship functionality in my Laravel application and saw Crypt is available from within blade view templates. Is this a common practice when trying to send ...
1vote
0answers
34views
Duplicating answers from a multi-section form populating multiple tables
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 ...
3votes
1answer
76views
Rounding a decimal to the nearest (up or down) 50's integer
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: ...
3votes
2answers
106views
Sending Firebase Cloud Messaging Notifications via FCM HTTP v1 API with PHP
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 ...
4votes
4answers
182views
Reversing string in PHP
I got this task to evaluate my knowledges in PHP. I was asked to avoid using functions like strrev() or array_reverse(). ...
2votes
0answers
50views
Testing PHP CodeIgniter 3 controller with PHPUnit
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 ...