Skip to content

Instantly share code, notes, and snippets.

@sinansh
Created January 24, 2017 06:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sinansh/fb1ca14604372ef7f3e2d474b2b89149 to your computer and use it in GitHub Desktop.
Save sinansh/fb1ca14604372ef7f3e2d474b2b89149 to your computer and use it in GitHub Desktop.
<meta charset="UTF-8">
<?php
$url="http://kutuphane3.omu.edu.tr/nisan2016.htm";
$cek = file_get_contents($url);
preg_match('#<table border="0" cellpadding="0" cellspacing="0" width="100%">(.*?)</table>#s',$cek,$table);
//print_r($table[0]);
preg_match_all('#g">(.*?)</a>#s',$table[0],$baslik);
preg_match_all('#<a href="(.*?)">#s',$table[0],$resim);
preg_match_all('#<i>(.*?)</i>#s',$table[0],$kaynak);
echo "<br />basliklar<br />";
print_r($baslik[1]);
echo "<br />".count($baslik[1])."<br />";
echo "<br />resimler<br />";
print_r($resim[1]);
echo "<br />".count($resim[1])."<br />";
echo "<br />kaynak<br />";
print_r($kaynak[1]);
echo "<br />".count($kaynak[1])."<br />";
?>
@sinansh
Copy link
Author

sinansh commented Jan 24, 2017

preg_match_all('#(.*?)#s',$table[0],$kaynak);

(.*?) ile aldığım değeri strip_tags() ile html tagları temizlemek istiyorum.

screenshot from 2017-01-24 09-18-08

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment