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 #183818 is a reply to message #183811] Thu, 21 November 2013 20:27 Go to previous messageGo to previous message
Thomas 'PointedEars'  is currently offline  Thomas 'PointedEars'
Messages: 701
Registered: October 2010
Karma:
Senior Member
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.

You are probably looking for a template engine like <http://www.smarty.net/>
then.

> […]
> For example, it looks like I could choose between PHP's expand(), fgets()
> and regular expression handling.

There is no built-in expand() function in PHP. fgets() reads files line by
line; HTML converts whitespace outside of attribute values to one space –
not what you want. Regular expressions are used for pattern matching; I do
not see how they would be applicable here.

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

Depends on what you *really* want to do.


PointedEars
--
realism: HTML 4.01 Strict
evangelism: XHTML 1.0 Strict
madness: XHTML 1.1 as application/xhtml+xml
-- Bjoern Hoehrmann
[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: Thu Nov 28 10:30:05 GMT 2024

Total time taken to generate the page: 0.04098 seconds