Dear group,
The function to be used as follows:
$links = "http://www.campaignind ia.in/feature/analysis";
$tag1 = '<div class=feature-wrapper>';
$tag2 = '<h1><a href';
$tag3 = "</a>";
$op = doGetTags($link s,"START",$tag1 ,$tag2,$tag3,"E ND");
return:
The exploded array of the page of link
<?php
function doGetTags()
{
$expCounter = 0;
$numargs = func_num_args() ;
$toExplode_enco ded = array();
$link="";
$condentExplode d = "";
if ($numargs <= 1)
{
echo "The argument can not be less that two";
die();
}
$arg_list = func_get_args() ;
for($i = 0; $i < $numargs; $i++)
{
if($i == 0)
{
$link = $arg_list[$i];
$first_delimite r = $arg_list[++$i];
for($j=$i; $j < count($arg_list ); $j++)
{
if($arg_list[$j] != "START" && $arg_list[$j] != "END")
{
$toExplode_enco ded[$expCounter] =
htmlentities($a rg_list[$j]); // the tag to be exploded and striped
with attributs
$expCounter++;
}
}
}
}
$aContext = array('http' =array('proxy' =>'tcp://
192.168.10.131: 8020', 'request_fullur i' =True));
$cxContext = stream_context_ create($aContex t);
$fpcont= file_get_conten ts($link, False, $cxContext);
foreach($toExpl ode_encoded as $key =$val)
{
$delimiter = '\''.$val.'\'';
$condentExplode d = explode($delimi ter,$fpcont);
print_r($conden tExploded);
}
}
$links = "http://www.campaignind ia.in/feature/analysis";
$tag1 = '<div class=feature-wrapper>';
$tag2 = '<h1><a href';
$tag3 = "</a>";
$op = doGetTags($link s,"START",$tag1 ,$tag2,$tag3,"E ND");
?>
when I pass the delimiter in explode(), directly for
example $condentExplode d = explode('<div class=feature-wrapper>',
$fpcont);
it working perfectly,the array is exploded. Thanks for any help
Comment