How can I get a specific string within a string using PHP?
i tried to used preg_match, but the result was not what I wanted.
Example String:
Creator: Adobe InDesign CC (Macintosh) Producer: Adobe PDF Library 10.0.1 CreationDate: Fri Aug 8 10:37:26 2014 ModDate: Fri Aug 8 10:37:29 2014 Tagged: no Form: none Pages: 2 Encrypted: no Page size: 612.283 x 858.898 pts (rotated 0 degrees) MediaBox: 0.00 0.00 612.28 858.90 CropBox: 0.00 0.00 612.28 858.90 BleedBox: 0.00 0.00 612.28 858.90 TrimBox: 8.50 8.50 603.78 850.39 ArtBox: 0.00 0.00 612.28 858.90 File size: 28176860 bytes Optimized: no PDF version: 1.6
This is a result for pdfinfo test.pdf comandline:
What i want.. is to get the specific string like this:
MediaBox: 0.00 0.00 612.28 858.90 CropBox: 0.00 0.00 612.28 858.90 BleedBox: 0.00 0.00 612.28 858.90 TrimBox: 8.50 8.50 603.78 850.39 ArtBox: 0.00 0.00 612.28 858.90
And put it in an array list.. The result would be something like this:
[
'Mediabox' => [0.00,0.00,612.28,858.90],
'CropBox' => [0.00 0.00 612.28 858.90],
'BleedBox' => [0.00 0.00 612.28 858.90],
'TrimBox' => [8.50 8.50 603.78 850.39]
]