Any custom PHP (or other custom script) development at your end would be entirely up to you, as we cannot advise you on general-purpose programming techniques. You might want to look up references on PayPal IPN, since our Integration submissions are designed to follow PayPal's IPN data format for easy compatibility with third-party services and "off the shelf" scripts designed to accept IPN. Just make sure you are not trying to validate the IPN with PayPal (which would fail since the submissions are coming from us rather than PayPal, and we validate the original IPN with PayPal before forwarding it to you anyway), and make sure your script can handle or ignore some extra fields we add to the base IPN data spec, for data we collect or provide that PayPal does not.
All that said, we can certainly explain how things work at our end, such as the "X" in item-specific variable names that we can submit to your URL via our Integration feature.
Whenever we POST to your Integration URL, we always provide the complete order data, including data for all items in the order, regardless of whether we're submitting to a Common Notification URL (for all orders) or to a Payment Variable Information URL (only for orders of a specific product).
The item-specific variable names will each have a numeric suffix corresponding to the item's cart position in that order, so you can tell which variables go together for which item in the orcer. E.g., 'item_name2' goes together with 'item_number2' and other item variables suffixed with '2', all referring to the same item in that order, where the '2' indicates that was the second item listed in the buyer's cart.
When we POST this full set of order data to a Payment Variable Information URL given in the settings of a specific product, you may want to know which particular item in the order triggered that particular submission, and that's what the 'item_cart_position' variable reveals. E.g., if item_cart_position=2, you will know the 2nd item in the cart was the one that had the Pmt. Var. Info. URL configured which triggered that particular submission, so data pertaining to that item would be given as 'item_name2', 'item_number2', etc. in that submission.