|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Stay one step ahead of the competition. Evaluate and give feedback
on some of the hottest web development tools on the market today.
Make your opinion heard! Click
Here
|
|
#1
|
||||
|
||||
|
Right, let me give you the background:
i have a file with a list of words in the format of lookfor|replace with eg a|b c|d I need some code which will grab a remote file, eg www.somesite.com/somedir/site.html perform the replacements, and spew out the results on the local server further, i need it to skip any code such as javascript/html tags, embeded flash files i dont want the images downloaded to the local server so image urls need to be modified so they point to the file on the remote server, eg images/image.gif would be changed to www.somesite.com/somedir/images/image.gif i also need the ability to change links in the same way! if you have anything that can do this let me know! Thanks Tom |
|
#2
|
||||
|
||||
|
Is this for your cockneyizer site? Why don't you show us what you've got so far? Just out of curiosity, does it have to be C/C++ or can it be any language?
|
|
#3
|
||||
|
||||
|
could be
![]() ive got it sort of working in php, but id prefer it in C because it would be far more efficient Code:
<?PHP
$input = implode("", file($file));
include('dictionary.inc.php');
while(list($text,$image) = each($replace)){
$patterns[0] = "//src=\"..//";
$replacements[0] = "//src=\"$file//";
$input = preg_replace($patterns, $replacements, $input);
$input = str_replace($text, $image, $input);
}
echo $input;
?>
|
![]() |
| Viewing: Dev Shed Forums > Programming Languages > C Programming > Advanced Search and Replace or remote file |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|