V
My apologies for the late response and any confusion I might have caused by switching to integers within the post. The big/little-endian format was indeed the issue. Adding a '>' sign in both the micropython and the php script solved the problem. This is what I ended up doing.
Micropython encoding
# Pack data
data = struct.pack('>5i', 25, 36, 81, 11)
# Send data
print('Sending data')
lora.join(activation=LoRa.ABP, auth=(dev_addr, nwk_swkey, app_swkey))
s = socket.socket(socket.AF_LORA, socket.SOCK_RAW)
s.setsockopt(socket.SOL_LORA, socket.SO_DR, 5)
s.setblocking(True)
s.send(bytes(data))
s.setblocking(False)
PHP decoding
$struct = new Struct();
$decoded_payload = $struct->unpack('>5i', hex2bin($decrypted_payload));
$data = [
'var1' => $decoded_payload[0]/10,
'var2' => $decoded_payload[1]/10,
'var3' => $decoded_payload[2]/10,
'var4' => $decoded_payload[3]/10,
'var5' => $decoded_payload[4]/10
];
The PHP struct class I used in the PHP decoding script can be found here.
Thanks a lot for your help!