Extract data using regular expressions.
Perl regular expressions in PHP.
Date Created:Wednesday July 16th, 2008 02:38 PM
Date Modified:Sunday August 03rd, 2008 01:23 PM
<?php
function readhtml($link, $contents, $folder_id) {
$name = select_folder_name($link, $folder_id );
$folderpath = getfolderpath($link, $folder_id);
preg_match_all("/<img src=\"(.*)\">/i", $contents, $match);
$match = $match[1];
if ( is_array($match) ) foreach ( $match as $file ) {
$id = return_newest_version_by_name($link, $file, $folder_id);
$contents = str_replace('<img src="'.$file.'">', '<img src="folders/'.$folderpath.'/'.$id.'__'.$file.'" alt="'.$name.'">', $contents);
}
return $contents;
}
?>
Downloads:
Download: extract.php 540 B
Please login or Click Here to register for downloads
Extracting Data by Dan Lynch
is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 United States License
Based on a work at www.3daet.com
Permissions beyond the scope of this license may be available at http://www.3daet.com
