per ora, con qualche altro tentativo sono riuscito ad arrivare a questo:
codice:
preg_match_all('/<img[^>]+>/i',$node['text']['value'], $result);
foreach( $result as $tmp) {
foreach($tmp as $id => $img_tag) {
preg_match_all('/(alt|title|width|height|style|src)=("[^"]*")/i',$img_tag, $img[$id]);
}
}
debug($img);
Che mi restituisce
codice:
Array
(
[0] => Array
(
[0] => Array
(
[0] => style="float:right;margin-left:10px"
[1] => src="http:\\localhost/test/app/webroot/files/image/Sfondo.png"
[2] => height="187"
[3] => width="250"
)
[1] => Array
(
[0] => style
[1] => src
[2] => height
[3] => width
)
[2] => Array
(
[0] => "float:right;margin-left:10px"
[1] => "http:\\localhost/test/app/webroot/files/image/Sfondo.png"
[2] => "187"
[3] => "250"
)
)
[1] => Array
(
[0] => Array
(
[0] => src="http:\\localhost/test/app/webroot/files/image/32.jpg"
[1] => alt="immagine"
[2] => height="50px"
[3] => width="40px"
)
[1] => Array
(
[0] => src
[1] => alt
[2] => height
[3] => width
)
[2] => Array
(
[0] => "http:\\localhost/test/app/webroot/files/image/32.jpg"
[1] => "immagine"
[2] => "50px"
[3] => "40px"
)
)
)
Già non è male, come risultato, ma come faccio a mantenere il tutto nelle posizioni originali?