Hi
I’m working on a class to get mails and saves it i an archive.
To grab the inlined images of the message i use ‘preg_match_all’ to grab the path to the images, which will be changed later.
It works perfect in this example:
[code=php]
$message = ‘<img width=”220″ height=”43″ id=”_x0000_i1028″ src=”cid:[email protected]″ alt=”Data Gården logo”>’;
$SearchImageName = ‘image001.jpg’;
preg_match_all(‘/src=”cid:(‘.$SearchImageName.’)(.*)”/U’, $message, $inline_match_array[]);
In this example the above search pattern does not work because it only has a wildcard behind the $SearchImageName. But I can’t make it work with a wildcard in front of the $SearchImageName.
I also have a problem with the file extension has been changed to .ashx instead of .jpg :
[code=php]
$message = ‘<img id=”content_0_img” src=”http://danskeark.dk/~/media/Dark/Nyheder/Fokus-fotos/2012_10_17_fokus%20kopi.ashx?mw=470&as=1″>’
$SearchImageName = ‘2012_10_17_fokus kopi.jpg’;
Any ideas for a search pattern?