There are 2 arrays: one is collected from a query to the database, the other is a response from the kernel via ZeroMQ. Here they are:
one.
array(2) { [0]=> array(4) { ["id"]=> string(1) "1" ["title"]=> string(25) "Numer One" ["enabled"]=> string(1) "1" ["source"]=> string(71) "rtsp://..." } [1]=> array(4) { ["id"]=> string(1) "2" ["title"]=> string(27) "Number Two" ["enabled"]=> string(1) "1" ["source"]=> string(87) "rtsp://..." } }
2
array(2) { [6139]=> string(1) "1" [6140]=> string(1) "2" }
The values in the second array are id, the keys are PID. What I'm trying to do:
array(2) { [0]=> array(4) { ["id"]=> string(1) "1" ["pid"]=> string(4) "6139" ["title"]=> string(25) "Numer One" ["enabled"]=> string(1) "1" ["source"]=> string(71) "rtsp://..." } [1]=> array(4) { ["id"]=> string(1) "2" ["pid"]=> string(4) "6140" ["title"]=> string(27) "Number Two" ["enabled"]=> string(1) "1" ["source"]=> string(87) "rtsp://..." } }
PS I know very well how to implement using SQL, but how to do it in PHP - I won’t put my mind to it :(