Paragraph Break

Nov 6, 2005

I have searched through this forum but I've drawn a blank. What I want to do seems simple enough. I want users who fill in a text area to be able to include a new paragraph break.

I have used HTMLSpecialChars for security reasons, and now, paragraph breaks disappear.
I have in mind the posibility of asking users to enter something like --P-- and then have my script change that part of the string into <p>.

View 2 Replies


Break Long Paragraph Into READMORE.. LINK?

here is a prob which stuck me at the wall...the prob is.... i wanna to break long paragraph into READ MORE....... link.... but i m not getting any way that how to do this job...i want that, just display 50 characters of the paragraph at main page.. and further show as a read more LINK... when a user click at read more link.. he must direct to the page where he can read whole paragraph..

View 1 Replies

Any Type Of Line Break Or New Paragraph The Script Wont Rotate At All?

I have a simple javascript code to switch out the text between a div there are 4 rotations.the text that is being switched is populated from my DB using php. now the weird my DB i'm using longtext now If the text in the db is all one paragraph everything works fine but if there is any type of line break or new paragraph the script wont rotate at all.

View 5 Replies

Html - Remove Wrapping Paragraph But Only If It's The Only Paragraph?

How to remove the (in this case, useless) wrapping paragraph in cases like this:

<p>Only paragraph</p>

But to keep the string as it is when there is more than one paragraph involved:

<p>Paragraph 1</p>
<p>Paragraph 2</p>

preg_replace would probably do the trick in here but only if you can handle regexps.. :/

View 1 Replies

First 500 Words Of Paragraph

If you have your own blog, you may notice this feature:

you write a long article and add it to your blog. In your blog homepage visitors can see a summary of this article plus a "Read More" link. The summary is the first, let say, 500 words of your article.

It's a piece of cake if you use plain text only, however, you've already used HTML tags like <img>, <p>, <ul>, <li>, <a href>.... So the question is, how to remove some tags (e.g.<img>) and get the first 500 words without breaking other tags (<ul>. <li> and <anchor>)

View 1 Replies

How To Get Last Two Sentenses From A Paragraph

Does anybody have any idea to get the last two sentences from a paragraph? If it is the first 'n' then its not that difficult. Code:

View 1 Replies

Paragraph Format

I have a section on my site where a member may submit info of themselves in a text box. When this info is called up to be viewed there is no structure to the paragraphs. There are no indents or skipped lines etc. It just prints staight from the database on one line utill the page ends, then goes to the next line without indents, skipped lines etc. How can I call up this info where the paragraph will be formatted the same as it is when it is submitted.

View 8 Replies

Know The Height Of A Paragraph?

I would like to know the height of a paragraph.

View 3 Replies

Separating First Paragraph From Others?

Let's say, that I have the following source output:

<p>This is first paragraph</p>
<p>This is second paragraph</p>
<p>This is third paragraph</p>

What I want to achieve is... I want to split them, first paragraph goes into one variable, others into other. Like:

$first = "<p>This is first paragraph</p>";
$next = "<p>This is second paragraph</p><p>This is third paragraph</p>";

Because those are generated by TinyMCE and user input, I can never know when user will add <br /> or other tags, which will cause TinyMCE to generate a new code-break . Therefore, all the solutuons which split them by looking for won't work this time.

View 1 Replies

Extracting A Paragraph?

I have this very poorly written code which will extract the first paragraph after a specified marker. I would like to see a better written code snippert which will do the same thing, perhaps using a regExp (which I do not understand all that well).Known parameters:

1) the paragraph will start after a string of dashes
2) there will be a hard return after the string of dashes
3) each paragraph will end with a hard return which you may identify with chr(10).

The following code works, but surely there is a better way to write this:


View 1 Replies

Paragraph Formatting

we have some paragraphs that have <BR>,<P> buried in them and want to modify them so that <BR> stars a new line and <P> begins a new paragraph. We tried
the below:

$NOTE = str_replace("<P>","n
$NOTE = str_replace("<BR>","

It looks like the 1st replace does not work and the second one does. We are outputting the paragraphs to a PDF generatorn and it needs a text file with proper line and paragraph codes.

View 1 Replies

How To Do Paragraph Formatting

I've been learning from the website for a long time now and I decided to start a small project. I'm writing some software that will be used by me as a type of blog, it's going really well and I'm almost finished.

I've got a problem though, I wish to know how to do paragraph formatting. When I enter large amount of text inside a textbox, I want it to be formatted as it's typed in the textbox when it's output.

View 2 Replies

Grab Words Out Of A Paragraph

I have a paragraph of text but I need to highlight certain words. I will be implementing this in a search engine I have. I was curious what the function is for me to pick out words of a paragraph. Also, if you know how I can highlight these words that would be great too.

View 1 Replies

Retrieve ONLY First 100 Words Of The Paragraph From DB

This is just a simple data retrieve from database. What I need to view is ONLY THE FIRST 100 words from one of the columns of the members table. Code:

View 5 Replies

Preserve Paragraph Breaks

Only just noticed this but:

$content = nl2br($content);
$print "<p>$content</p>";

Produces this:

<p>line 1<br />
line 2<br />
<br />
line 3</p>

Can it be done with somethind so the following occurs:

<p>line 1</p>
<p>line 2</p>
<p>line 3</p>

View 1 Replies

How Use Regular Expression In Paragraph

i want to ask how use regular expression in paragraph like this.

example : file configuration at linux with name = httpd.conf

documentroot /var/www/html/


1. how can i find with reqular expression the word
2. than make a variabel?

View 7 Replies

Find Letters In Paragraph?

Let's say I have this sentence. "The dog took the kid's bone." Well using PHP, can I find specific letters inside that sentence (if any at all) that I specify? So for example, I want to find the letters g, t, h, and e. Then the sentence would appear like:

The do g -- t ook t h e kid's bon e. (sorry about formatting...) See how certain letters are bolded (highlight in a way). They are from the g,t,h, and e combo I wanted. Is there a way to do this in PHP?

Also, I forgot to mention that once a letter is found... it cannot be bolded again. So if I was looking for a t* and the letter t appeared more than once... it would ONLY highlight ONE (the first) t... UNLESS I specify to find more than one t.

View 2 Replies

Dom Element Of Paragraph's Text?

I need to get the text of a paragraph. Simple, right?! Here's the code.


It works perfectly, grabs the class of every div on the page and echoes it out. But what I really need to do is find all <p> tags - every one on the page - and echo the text that is in between the <p>! I have a feeling it's simple but I just can't figure it out. edit All it took was the following:

$doc = new DOMDocument();
$node = $doc->getElementsByTagName('p')->item(3);
echo $node->textContent."

What you really want is getElementsByName and then once you have the node, you textContent for the win.

View 2 Replies

Highlight Keywords In A Paragraph?

I need to highlight a keyword in a paragraph, as google does in its search results. Let's assume that I have a MySQL db with blog posts. When a user searches for a certain keyword I wish to return the posts which contain those keywords, but to show only parts of the posts (the paragraph which contain the searched keyword) and to highlight those keywords.

My plan is this:

find the post id which has the searched keyword in it's content; read the content of that post again and put each word in a fixed buffer array (50 words) until I find the keyword.

View 6 Replies

Search For A Sentence In A Paragraph?

How can I search a paragraph for one or more sentences using PHP ?

View 3 Replies

Incrementing Input Per Paragraph?

im learning PHP & SQL very quickly, but still have issues with counting this, and incrementing that.... so if someone could help, you'd be(proverbially) teaching a man(woman in my to fish Im constructing a form which in part, allows user to input instructions. I would like the users input to increment with numbering, each time user hits "enter" in the textarea to make a paragraph, so that the output looks something like:

step 1. blah blip blah
<user hits "enter", makes paragraph>
step 2. blah blur blah
<user hits "enter", makes paragraph>
The best example I have is on the website
so for example:[URL]..

which is just an awesome site btw for any of u who like to cook. If you look to how their "Directions" on recipe pages increment, you will see what I am trying to explain, god help my explainatory abilities. The way in which i explained i would like input incremented, is how they increment it on this website.... user presses "enter"..input is incremented..

View 7 Replies

Echo A Paragraph Containing A String?

I'm looking for a bit of help, I'm starting out learning PHP and am trying to find a string in from a bunch of paragraphs on a page. Then echo the complete paragraph that string was found in. Links to tutorials or ideas of how I would go about it?

View 21 Replies

How Do I Limit A Paragraph To A Set Number.

how do i limit a paragraph to a set number. like if i got a strory and i only want 15 words to show how would i do it? Code:

View 10 Replies

ImageTTFText Paragraph Issue

Is it possible to take text from a POST that is being written to an image using the GD ImageTTFText function and breaking it apart so that it writes like a paragraph.

For example if you have "Welcome to the happiest place on earth" typed into the input text box and subinted but the width of the image it is being written too only is wide enough to hold "Welcome to the happiest", is there a function that automatically breaks text in the image to a second line?? or do I have write my own function for that?

View 8 Replies

Show Text From Mysql By Paragraph

I am trying to develop a site for news paper. i keep articles in a longtext field in Mysql. But when a retrieve the data from database. i lose all paragraphs. the total article in shown in one paragraph.

But i want them be as it is the way i paste them. Pls help to do find out the solutions.

View 1 Replies

Page Not Parsing New Paragraph Correctly?

i have a simple WCMS im writing and ive got the content editor working which is a simple text box but im having problems with the content being parsed on the webpage itself when the content.

i entered in the editor is saved to the database it saves everythign i type like when i create a new paragraph yet when it parsed on the front display page break between the paragraphs is gone yet its there in the database?

View 1 Replies

Copyrights 2005-15, All rights reserved