Questions tagged [php]
PHP is a widely-used, general-purpose scripting language that is especially suited for web development.
4,262 questions
1
vote
2
answers
148
views
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 ...
3
votes
1
answer
46
views
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, ...
4
votes
2
answers
464
views
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 ...
3
votes
1
answer
54
views
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 ...
4
votes
1
answer
144
views
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?
...
5
votes
1
answer
543
views
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 ...
3
votes
0
answers
44
views
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 ...
4
votes
1
answer
130
views
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
...
4
votes
3
answers
1k
views
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 ...
1
vote
0
answers
41
views
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 ...
1
vote
0
answers
34
views
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 ...
3
votes
1
answer
76
views
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:
...
3
votes
2
answers
106
views
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 ...
4
votes
4
answers
182
views
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().
...
2
votes
0
answers
50
views
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 ...