i have page in that approx 10-15 links are there and all links are in my control and end with some words like celebrity i want to filter all links ending with that word so i have written this
$regex='|<a.*?href="(.*_celebrity)"|';
preg_match_all($regex,$result21,$parts);
$links=$parts[0];
foreach($links as $link){
{
echo $link."<br>";
mysql_query ("INSERT INTO tablea(linkssas) VALUES ('$link')");
}
it does the job and filters all links which is ending with _celebrity but the output is not entering in database.all links are entering in one row and it is not plain it is in the form of anchor text but i want plain links in the database as i am using foreach so all links should be entered in seperate row but all rows are entering in single row and in the form of anchor like http://xyz.com/edje/jjeieied_celebrity">A</a>
but i want only links in database