Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- include_once 'lib/Simple_html_dom.php';
- $string = '
- <p>Aliquam vehicula faucibus tellus. Praesent condimentum commodo libero,
- sit amet pellentesque metus bibendum sit amet. Donec commodo tortor in
- libero consequat suscipit. Maecenas eget augue vulputate neque pulvinar lobortis.
- Fusce posuere lorem scelerisque, facilisis velit eu, vehicula nulla. Mauris
- vestibulum vulputate justo, et tincidunt neque imperdiet eget.</p>
- <img alt="" src="/upload/ckeditor/CARTOAEROMED2.jpg" style="width: 800px; height: 648px;" />
- <img alt="" src="/upload/ckeditor/CARTOAEROMED2.jpg" style="width: 800px; height: 648px;" />
- <img alt="" src="/upload/ckeditor/CARTOAEROMED2.jpg" style="width: 800px; height: 648px;" />';
- $html = new Simple_html_dom($string);
- $result = new stdClass;
- foreach($html->find('img') as $img)
- {
- $src = '"" src="/common/function/thumb.php?url=../..' . $img->src . '" class="img-responsive img-rounded" ';
- $result = preg_replace('/src([=]|\s=)"(.*)"/', $src, $string);
- }
- print_r($result);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement