I have a payload in a format similar to below:
{
"year": "2022",
"cycle": "Aug",
"origin": {
"file_location": "GDT Post-Distribution Manifest/Italy/Rome/2022/Aug/Italy Rome_202208241528.xlsx",
"protocol": "s3:"
}
}
I want to check if the third element of the file_location is equal to something (in this case it is marked as Rome).
How do I gain access this element?
In order to achieve this, you would need to have some sort of functionality to split a string, which is, sadly, not something that exists in the language for the moment being.
There is a proposal to add the functionality, though: New function: array[string] split(string $separator, string $subject).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With