Hi guys,
Sometimes you need to show a few lines in your index page from one or more than one pages like About Us, Vision & Mission and etc… and create a More… button for clicking and showing all data.
In this tutorial I am going to show, how to create page break or read more button in your pages. It is very simple all you have to do is just create a tag </break> where you want to create read more buttons. And It’s Standard ASCII Code is </break> and we are going to use these codes in our PHP script.
Ok let’s start our tutorials
First we need to create our tablespages table

After that insert some data in table, and try to use </break> in you code example:

Fernando was taken unconscious to a hospital, where he died four days later. Pathologists said he had 30 bruises and brain hemorrhaging, signs of a fatal beating. Olivas did not testify at his trial but denied guilt and continues to maintain his innocence, defense lawyer Peter Gold said Friday.</break>
In a 3-0 ruling Thursday, the First District Court of Appeal rejected defense claims that the prosecutor had discriminatory motives in removing four Latinos from the jury panel.
The court cited the trial judge's findings that the prosecutor had offered acceptable race-neutral reasons. For example, the court said, one juror was 20 years old, another indicated a willingness to question medical testimony, and a third had a daughter who was a social worker, which might lead the juror to have liberal views on crime.

Code Explanations:include("config.php"); config.php contain database information.$str = "SELECT * FROM pages"; String query for getting all data from table
if(isset($_GET['id'])){
$id = $_GET['id'];
$str.=" WHERE ID=$id";
}
This piece of code is use when someone clicked on read more button, and its filtering query with id of page and Concatenate some data with $str variable.$pages_query = $mysqli->query($str)or die(mysqli_error($mysqli)); execute query $str variable.$pages_fetch = $pages_query->fetch_assoc(); fetching query into $pages_fetch variable or getting all data from query and assigning it in $pages_fetch variable.$data = $pages_fetch['Data']; assign page data into $data variable.$separator = "</break>"; ASCII code of</break> and it is for separating the paragraph.
if(!isset($_GET['id'])){
$data = explode($separator,$data);
echo $data[0];
echo "<br /><a href='pages.php?id=".$pages_fetch['ID']."'>More...</a>";
}else{
when page load for the first time or no one clicked on More… button then this code will execute, $data = explode($separator,$data); split or separate paragraph into arrayecho $data[0]; science it is an array and we are showing data from echo str_replace($separator,"",$data); remove </break> when showing full data.
Thanks for reading