Help preserving sentence structure

--0016e64c1f489cf3600480867fc5
Content-Type: text/plain; charset=ISO-8859-1

Hi, new to this list...

I'm adapting some code that generates text and want to keep the syntax. In
the original version the output was iterated from an array in <pre> tags.
That was fine for what it was, but it's now a word press plugin and the
<pre> tags get in the way. How do I keep the sentence structure without
using <pre>s? Also, I'm quite new to PHP in general... :) Any help would
be much appreciated!

Below is an extract of the code with some highlighting for emphasis:

function wpm_display_generator() {

if (isset($_POST['submit_button'])) {

// the form was submitted to this script - generate
// and display
require_once 'lib/generator.php';
require_once "lib/util.php";
require_once "lib/vocabulary.php";
require_once "lib/widgets.php";

$vocab = Vocabulary::getInstance();
$cats = $vocab->getCategories();
$catName = '';
$sentence = '';
if (isset($_POST['category_choice'])) {
$catName = $cats[$_POST['category_choice']];
$gen = new wordGenerator($_POST['category_choice'],
$_POST['length_choice']);
$lines = $gen->generate();
foreach ($lines as $line) {
$sentence .= "<pre>" . $line . "</pre>";
}
}

require 'sentence.php';
}
else {
require 'generator_form.php';
}
}


Many thanks,

John

--
Out now:
Kvist 002 - Raglani - Web of Light - 12"
Kvist 003 - EOD - untitled - 12"
Kvist 004 - JD Emmanuel - Solid Dawn - CD
Kvist 005 - Guillaume Gargaud - Here - CD

Coming soon:
Kvist 006 - Tom Hamilton - Pieces for Kohn/Formal & Informal Music - CD

www.kvistrecords.com

--0016e64c1f489cf3600480867fc5--
John Tamm-Buckle [ Fr, 26 Februar 2010 21:11 ] [ ID #2033553 ]

Re: Help preserving sentence structure

http://us.php.net/manual/en/function.htmlentities.php

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Ryan Sun [ Fr, 26 Februar 2010 23:59 ] [ ID #2033594 ]
PHP » gmane.comp.php.general » Help preserving sentence structure

Vorheriges Thema: Registry class question.
Nächstes Thema: ctype_print, the British Pound and other non-ASCII characters