want to add a break after a certain amount of characters


Posted on 16th Feb 2014 07:03 pm by admin

i was wondering how to add a break in a blog post after a certain amount of characters... any idea on how to do this???

this is the code i'm workig with

Did you know?Explore Trending and Topic pages for more stories like this.
<?php

$connect = mysql_connect("localhost", "root", "") or die(mysql_error());
mysql_select_db("blog", $connect) or die(mysql_error());

echo "<h1>Blog</h1>";

$query = mysql_query("SELECT * FROM blog");

if (mysql_num_rows($query) == 0) {
echo "<hr />There are no posts yet, make the first in the admin section!";
} else {
while ($row = mysql_fetch_assoc($query)) {
echo "<hr />";
$title2 = $row['title'];
$name = $row['name'];
$email = $row['email'];
$post = $row['post'];
$date = $row['date'];
$time = $row['time'];

echo "<h3>Title: " . $title2 . "</h3><table width='100%'><tr><td><b>Posted by: " . $name . "(" . $email . ") at " . $time . " on " . $date . "</b></td></tr><tr><td>" . nl2br(strip_tags($post)) . "</td></tr></table>n";
}
}

echo "<hr />";

$page = $_GET['p'];
if ($page) {
$path = "/inc/" . $page . ".php";
if (file_exists($path)) {
include ($path);
}
}

echo "Are you an admin? <a href='index.php?p=blog&p=credentials'>Place a post</a>";

?>
No comments posted yet

Your Answer:

Login to answer
117 Like 36 Dislike
Previous forums Next forums
Other forums

COde for a Cc
I'm not receiving $ft as a Cc. Why is that??

$to = "$email";
$headers = "Fr

Compare user input to flat file data
Help...Am a complete newbie to programming so my code is prolly quite long. Am trying to verify a us

disabling a button server-side then re-enabling client-side breaks button postback
I have a tabbed container and a button (not in the container) on a page. If the first tab is selecte

date function help
i need help with date function

Code: [Select]<!DOCTYPE HTML PUBLIC "-//W3C//DTD H

my two tables
table1 : col1 = topicid , col2 = topic

table2 : col1 = sentid, col2 = sentence

Cod

Blank record injected into database
I always found several blank records inside my database, although $SESSION is required to insert the

New to mysqli library - Multiple query problem
Greetings,

I am writing a batch program that executes 3 queries on a single page. Using mysql

rookie looking for help coding a CSS form with PHP
I'm trying to figure out how to add PHP code to my xhtml form so that it is a working form embedded

Object Interfaces
EDIT: Never mind, I just updated to php 5.

Hey all,

I'm currently experimenting with p

Multi-user card game
I'm writing a batch of games and such. Lottery is finished, Poker,blackjack,etc are next. They will

Sign up to write
Sign up now if you have flare of writing..
Login   |   Register
Follow Us
Indyaspeak @ Facebook Indyaspeak @ Twitter Indyaspeak @ Pinterest RSS



Play Free Quiz and Win Cash