I am trying to extract values from XML.My xml file contains a field for product "Description" that consists of Product bardcode, packets and pallets.
I want to extract only Pck (it could be any number from 1-999).
My xml attribute(Description) field values:
Description="5038135129483 
Pck: 4 Plt: 120"
Here
Barcode=5038135129483
Number of Packets(Pck)=4
Number of Palletes(Plt)=120
$pieces = substr($WhatDescription,19,20);
I have tried substr function to extract from string but it doesn't give me accurate results as the barcode 's length varies and I have got html characters in my XML. Could you advise what shall I do to extract Pck from above string in such away that my extraction wont depend upon html characters and barcode's length.