1,464,280 questions
- Bountied 0
- Unanswered
- Frequent
- Score
- Trending
- Week
- Month
- Unanswered (my tags)
-8
votes
0
answers
94
views
JSON doesn't saves properly [closed]
I have a problem with my function, the idea is to save products for a virtual store from the backend using javascript to get all PHP form data input and sent them through ajax to save such data in my ...
2
votes
1
answer
61
views
How do I set the timeout on a socket [duplicate]
I'm trying to make a web page that can query a game server for call of duty 2, i seem to get issues with create a socket_create() im using php 8.3 the error i get is:
Fatal error: Uncaught TypeError: ...
Advice
0
votes
5
replies
65
views
Bind a socket to several IP addresses
I developed a PHP websocket server :
$serverSocket = socket_create(AF_INET, SOCK_STREAM, SOL_TCP);
socket_set_option($serverSocket, SOL_SOCKET, SO_REUSEADDR, 1);
if (!socket_bind($serverSocket, $host,...
2
votes
1
answer
80
views
How to correctly call a php function when script terminates, even from an error?
I've already read several possible SO duplicates such as this
and particularly this where hipertrtacker says register_shutdown_function can catch fatal errors and Peter Mortensen showed code very ...
-1
votes
0
answers
37
views
Determining PHP/MySQL encoding differences on 2 machines: MySQL Error 1366 only on one machine [duplicate]
I have some PHP pdo code that is copying data from one table (wp_posts) to another (a relational table structure). This is in the same schema with default
CHARSET=utf8mb4 COLLATE=...
-2
votes
0
answers
84
views
PHP add, delete to xml file [closed]
I am trying to add and delete data from an XML file using PHP. The addition works, but when I try to delete, the element is not removed from Training.xml. No error appears, it just doesn't do anything....
-2
votes
0
answers
41
views
php8.3.29 Ubuntu 24.04 can't install bcmath [closed]
I don't understand the dependency problem. PHP8.3-common is installed but version 8.3.29
I can't understand why it seems to be asking for 8.3.6
root@choir:~# php -v
PHP 8.3.29 (cli) (built: Dec 18 ...
Advice
1
vote
13
replies
160
views
PHP Variable Naming
If I have several variables that are only differentiated by a numerical value within the variable name, is there a way to make the numerical value a variable itself and then pass that value to another ...
-2
votes
0
answers
69
views
PayPal OTP ‘transaction code’ SMS shows EUR for a GBP PayPal Checkout order [closed]
We are a UK merchant using WooCommerce + PayPal Checkout (PPCP) in production.
Some payers are prompted for an SMS OTP (‘prove it’s you’ / transaction code). The OTP SMS displays an amount in EUR (and ...
0
votes
0
answers
60
views
Hubleto PHP framework fresh install fails with "Cannot redeclare class Hubleto\App\Community\Discussions\Extendibles\AppMenu"
Using Hubleto 0.25 with PHP 8.1 to 8.5, on Windows (also tested on Linux and Docker, same result), I am trying to create a new app:
Initialize Hubleto:
php hubleto init
Create a new app:
php hubleto ...
4
votes
1
answer
82
views
Symfony AI: How to add additional models for the LM Studio bridge?
I’m working with Symfony AI and the LM Studio bridge to manage my language models locally.
My goal is to add custom models that are not included in Symfony’s default ModelCatalog.
My YAML ...
Advice
0
votes
7
replies
152
views
PHP shorthand for isset && truthy
Is there a shorter way to write the following in php?
$bar = isset($foo['bar']) && $foo['bar'];
or
$verylongname = isset($_POST['verylongname']) && $_POST['verylongname'];
I'm using ...
0
votes
3
answers
193
views
PHP, $regex to obtain each URL of videos about $pattern
I try with some regex to obtain only the URL of all the videos about $pattern but my $regex not work (in this case $pattern = "Greta"):
$data = '<p><a href="https://www.youtube....
5
votes
1
answer
107
views
Api Platform DTO is not comprehensible
version
symfony
7.4
symfony/object-mapper
7.4
api-platform/symfony
4.2
php
8.4
Describe the problem
So I've been reading about the new recommandation for API Platform which is to use and map DTO ...
-1
votes
2
answers
89
views
PHP - Loosing FTP connection [closed]
I'm trying to build a PHP class for a recursive directory listing. It's simple class, but for any reason I'm loosing the connection as it seems (Or the error is anywhere else, but I do not find.
The ...