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

Home » Imported messages » comp.lang.php » Thorny string translation issue.
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: Thorny string translation issue. [message #180796 is a reply to message #180787] Tue, 19 March 2013 09:38 Go to previous messageGo to previous message
The Natural Philosoph is currently offline  The Natural Philosoph
Messages: 993
Registered: September 2010
Karma:
Senior Member
On 19/03/13 00:40, SwissCheese wrote:
> On 03/18/2013 07:24 PM, The Natural Philosopher wrote:
>>
>>
>> The problem.
>>
>> 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 tranlsate e.g. '>' to
>> '&gt;' etc etc.
>>
>> Anyone done this before?
>>
>>
>
> http://www.php.net/manual/en/function.htmlspecialchars.php#101592
>
That of course was my first port of call, but it doesn't do the needed job.

I want a version of that that is intelligent, and knows what are HTML
tags, and leaves those alone, or what are simply isolated < and > chars.

I know a lot of sites use things like [URL] and [B] to encode markup for
this reason I suppose. to a special chars on them and THEN replace [
with < and so on..but then what happens if you actually want to encode a
'[' ?




--
Ineptocracy

(in-ep-toc’-ra-cy) – a system of government where the least capable to
lead are elected by the least capable of producing, and where the
members of society least likely to sustain themselves or succeed, are
rewarded with goods and services paid for by the confiscated wealth of a
diminishing number of producers.
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Hot list for BA/QA- Load Runner, Software Tester, Business Analyst/ Project Coordinator & SAP Business Object Developer
Next Topic: split array and string from string (trust me it will make sense when you read)
Goto Forum:
  

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

Current Time: Thu Nov 28 22:35:00 GMT 2024

Total time taken to generate the page: 0.05983 seconds