0

Thread safe arrays in PHP?

Hi guys, I want to implement websockets communication between PHP and Javascript. I'm executing a PHP script on the console and then. I need to output some values that this script generates. But the problem is that if any client is connected I can't send anything. By this reason, I need to wait until a client is connected on another thread. When a new client connects I store it on an array that I will access to send those messages. But I don't know how to do it? Any clue? Thanks so much!!

30th Jan 2020, 12:49 PM
Álvaro Rodríguez García
Álvaro Rodríguez García - avatar
7 Answers
+ 1
So you need to know how to access the array?
4th Feb 2020, 12:05 AM
George Ryan
George Ryan - avatar
+ 1
yes :3
18th Feb 2020, 12:15 PM
Bat Guy
Bat Guy - avatar
+ 1
tell me George Ryan :3
18th Feb 2020, 12:16 PM
Bat Guy
Bat Guy - avatar
+ 1
George Ryan tell me niw pls :3
18th Feb 2020, 12:19 PM
Bat Guy
Bat Guy - avatar
18th Feb 2020, 12:24 PM
Bat Guy
Bat Guy - avatar
+ 1
+_+ George Ryan why no tell me, why u lie, why do tat. why... no.....
18th Feb 2020, 12:25 PM
Bat Guy
Bat Guy - avatar
+ 1
me am cry.
18th Feb 2020, 12:27 PM
Bat Guy
Bat Guy - avatar