Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.php > #8733

Re: Thorny string translation issue.

From BootNic <bootnic.bounce@gmail.com>
Newsgroups comp.lang.php
Subject Re: Thorny string translation issue.
Date 2013-03-19 07:45 -0400
Organization BootNic Party Make your vote count!
Message-ID <20130319074520.4756c2eb@bootnic.server> (permalink)
References <ki87ne$s68$1@news.albasani.net> <ki8bbd$rrk$1@speranza.aioe.org> <ki9bcd$gu7$1@news.albasani.net>

Show all headers | View raw


[Multipart message — attachments visible in raw view] - view raw

In article <ki9bcd$gu7$1@news.albasani.net>, The Natural Philosopher
<tnp@invalid.invalid> wrote:

>> The Natural Philosopher wrote:

>>> I want the user to enter raw text and embedded HTML into a database.
>>> No trouble with getting it in, but when getting it out, it needs
>>> massaging for display..

>>> Now I cant find a function in the library that will skip html styles
>>> like <b>...</b> or <a...></a> code, and yet still tranlsatee e.g. '>'
>>> to '&gt;' etc etc.

[snip]

> Specifically consider the example

> <b> <= </b>

> where I want to display a bold 'arrow'

[url] http://php.net/manual/en/book.tidy.php [/url]

function tUp($content) {
 $config = array(
'indent'                        => 0,
'output-html'                   => 1,
'wrap'                          => 0,
'doctype'                       => 'strict',
'sort-attributes'               => 'alpha',
'output-encoding'               => 'utf8',
'char-encoding'                 => 'utf8'
);
  if (extension_loaded("tidy")) {

    $tidy = new tidy;
    $tidy->parseString($content, $config, 'utf8');
    $tidy->cleanRepair();
    $body = $tidy->Body();
    $content = $body->value;
    $content = trim(preg_replace("`<(/)?body>`", "", $content));

  }
  return $content;
}
print tUp('<b> <= </b>');

[snip]



-- 
BootNic                                               Tue Mar 19, 2013 07:45 am
  The only thing wrong with immortality is that it tends to go on forever.
  *Herb Caen*

Back to comp.lang.php | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Thorny string translation issue. The Natural Philosopher <tnp@invalid.invalid> - 2013-03-18 23:24 +0000
  Re: Thorny string translation issue. Christoph Becker <cmbecker69@gmx.de> - 2013-03-19 01:26 +0100
    Re: Thorny string translation issue. The Natural Philosopher <tnp@invalid.invalid> - 2013-03-19 09:33 +0000
      Re: Thorny string translation issue. BootNic <bootnic.bounce@gmail.com> - 2013-03-19 07:45 -0400
      Re: Thorny string translation issue. Christoph Becker <cmbecker69@gmx.de> - 2013-03-20 00:56 +0100
  Re: Thorny string translation issue. SwissCheese <swisscheese@cfl.rr.com> - 2013-03-18 20:40 -0400
    Re: Thorny string translation issue. The Natural Philosopher <tnp@invalid.invalid> - 2013-03-19 09:38 +0000
  Re: Thorny string translation issue. Jerry Stuckle <jstucklex@attglobal.net> - 2013-03-19 09:01 -0400
  Re: Thorny string translation issue. "Peter H. Coffin" <hellsop@ninehells.com> - 2013-03-19 07:58 -0500

csiph-web