FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » PHP functions to convert markup efficiently
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: PHP functions to convert markup efficiently [message #183815 is a reply to message #183813] Thu, 21 November 2013 19:10 Go to previous messageGo to previous message
Christoph Michael Bec is currently offline  Christoph Michael Bec
Messages: 207
Registered: June 2013
Karma:
Senior Member
James Harris wrote:

> "The Natural Philosopher" <tnp(at)invalid(dot)invalid> wrote in message
> news:l6lk04$e54$1(at)news(dot)albasani(dot)net...
>> On 21/11/13 18:30, James Harris wrote:
>>> I am looking for a way to mark up text in a way that PHP would be able to
>>> efficiently and quickly convert to HTML.
>>>
>>
>> mark the text up with HTML!
>
> No good. Too complex to vet, not secure (people other than me could add
> markup)

There are tools which help with this, e.g. <http://htmlpurifier.org/>.

> and would not allow enhanced functions that I anticipate needing to
> add. It needs to be markup I can control.

Then you may consider XML. There are several libraries dealing with XML
that come bundled with PHP[1].

>>> I could either use an existing markup language or design a new one but I
>>> wanted to know of which PHP functions would be ideal to use to process it
>>> most efficiently. To a large extent that will guide the choice of markup
>>> tags if I have to design it myself.
>>>
>>> For example, it looks like I could choose between PHP's expand(), fgets()
>>> and regular expression handling.

I never heard of a PHP function called expand(). Anyway, if you want to
use your own markup, regular expression are most likely the way to go,
as scanning by characters might be too slow in pure PHP.

>>> Of course, implemenations may differ slightly but, on average, are there
>>> certain PHP approaches that could be expected to be faster than others?

Most likely those which are programmed in C.

[1] <http://php.net/manual/en/refs.xml.php>

--
Christoph M. Becker
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: changing iframe source via php
Next Topic: converting numbers to ascii values
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Sun Nov 24 19:33:23 GMT 2024

Total time taken to generate the page: 0.04195 seconds