<?php
include"koneksiphp.php";
if(isset($_GET['id'])){
$id=$_GET['id'];
$query="SELECT
* FROM berita WHERE id='$id'";
$hasil=mysql_query($query)
or die("gagal");
while($data=mysql_fetch_array($hasil)){
echo
$data['judul']."<br>";
echo
str_replace("<>","",$data['isi']);
}
} else {
$query="SELECT
* FROM berita";
$hasil=mysql_query($query);
while($data=mysql_fetch_array($hasil)){
echo
$data['judul']. "<br>";
$artikel=$data['isi'];
$potongartikel=explode("<>",
$artikel);
echo
$potongartikel[0]. "<br>";
echo
"<a href=readmore2.php?id=$data[id]>readmore</a>";
echo
"<hr>";
}
}
?>
Skrip/Code PHP: Readmore dengan explode()
4/
5
Oleh
Unknown