Wiedmann wrote:Define "single instance of the word".
like if scan a
- Code: Select all
<?php
$url_feed='http://tech2.in.com/rssfeed/rss_topstuff.xml';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "http://validator.w3.org/feed/check.cgi?url=$url_feed");
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_BINARYTRANSFER, true);
$output = curl_exec($ch);
$fh = fopen("out.txt", 'w');
fwrite($fh, $output);
$value='img alt="[Valid RSS]" title="Valid RSS" src="images/valid-rss.png" /> This is a valid RSS feed.';
$section = file_get_contents('./out.txt', NULL, NULL, 1256, 95);
/*echo $section;
$fh1=fopen("out_1.txt",'w');
fwrite($fh1, $section);
fclose($fh1);
var_dump($section);*/
fclose($fh);
curl_close($ch);?>
this out.txt file the required single instance of word i require is $value, when i change the $url_feed the word will appear in the different place i mean in a different character count. i hope u got it out..
so i want a function instead of file_get_contents which will scan the entire txt file and will check for the $value and if it is there then it should display ok
if u require any other info just ping me back