Translation of html?

Translation of html?

am 18.06.2007 16:23:00 von Gustav Wiberg

Hi there!

Is this possible? I can't find any functions for this (I don't exactly what=
to search for)


Translation of

Html-string from=20

$str =3D "

This is a title>

test
";


To a string that is like:



This is a title

Test





?

Best regards
/Gustav Wiberg

--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: Translation of html?

am 18.06.2007 16:30:25 von Jarrett Meyer

Hack:
Explode on "<" will give you :

h1>This is a title
/h1>
table>
tr>
td>test
/td>
/tr>
/table>

Explode on ">", and only keep the second entry in the array. Would that work?

----
Jarrett M. T. Meyer
http://jarrettmeyer.blogspot.com
http://www.jarrettmeyer.com

No trees were harmed during this transmission; however, several electrons were terribly inconvenienced.

----- Original Message ----
From: Gustav Wiberg
To: "'php windows' (php-windows@lists.php.net)"
Sent: Monday, June 18, 2007 10:23:00 AM
Subject: [PHP-WIN] Translation of html?

Hi there!

Is this possible? I can't find any functions for this (I don't exactly what to search for)


Translation of

Html-string from

$str = "

This is a title>

test
";


To a string that is like:



This is a title

Test





?

Best regards
/Gustav Wiberg

--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

RE: Translation of html?

am 18.06.2007 16:32:14 von Bill Bolte

There isn't anything built in to PHP to do this but one could do it with
Regular Expressions. You might check through the Pear libraries or the
PHP classes website for functions/classes already built.=20

-----Original Message-----
From: Gustav Wiberg [mailto:gustav@hmn.se]=20
Sent: Monday, June 18, 2007 9:23 AM
To: 'php windows' (php-windows@lists.php.net)
Subject: [PHP-WIN] Translation of html?

Hi there!

Is this possible? I can't find any functions for this (I don't exactly
what to search for)


Translation of

Html-string from=20

$str =3D "

This is a =
title>

test
";


To a string that is like:



This is a title

Test





?

Best regards
/Gustav Wiberg

--=20
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

RE: Translation of html?

am 18.06.2007 16:36:00 von Gustav Wiberg

Hi there!

Isn't there any function for acheiving this? Of course I could do some rege=
xp... Is that the only way?


Best regards
/Gustav Wiberg=20

-----Original Message-----
From: Jarrett Meyer [mailto:jmtmeyer@yahoo.com]=20
Sent: Monday, June 18, 2007 4:30 PM
To: 'php windows' <\(php-windows@lists.php.net\)>
Subject: Re: [PHP-WIN] Translation of html?

Hack:
Explode on "<" will give you :

h1>This is a title
/h1>
table>
tr>
td>test
/td>
/tr>
/table>

Explode on ">", and only keep the second entry in the array. Would that wor=
k?
=20
----
Jarrett M. T. Meyer
http://jarrettmeyer.blogspot.com
http://www.jarrettmeyer.com

No trees were harmed during this transmission; however, several electrons w=
ere terribly inconvenienced.

----- Original Message ----
From: Gustav Wiberg
To: "'php windows' (php-windows@lists.php.net)"
Sent: Monday, June 18, 2007 10:23:00 AM
Subject: [PHP-WIN] Translation of html?

Hi there!

Is this possible? I can't find any functions for this (I don't exactly what=
to search for)


Translation of

Html-string from=20

$str =3D "

This is a title>

test
";


To a string that is like:



This is a title

Test





?

Best regards
/Gustav Wiberg

--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

--=20
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

RE: Translation of html?

am 18.06.2007 16:36:00 von Gustav Wiberg

Hi there!

Ok, thanx! Then I'll know!

Best regards
/Gustav Wiberg=20

-----Original Message-----
From: Bill Bolte [mailto:billb@hightouchinc.com]=20
Sent: Monday, June 18, 2007 4:32 PM
To: php-windows@lists.php.net
Subject: RE: [PHP-WIN] Translation of html?

There isn't anything built in to PHP to do this but one could do it with
Regular Expressions. You might check through the Pear libraries or the
PHP classes website for functions/classes already built.=20

-----Original Message-----
From: Gustav Wiberg [mailto:gustav@hmn.se]=20
Sent: Monday, June 18, 2007 9:23 AM
To: 'php windows' (php-windows@lists.php.net)
Subject: [PHP-WIN] Translation of html?

Hi there!

Is this possible? I can't find any functions for this (I don't exactly
what to search for)


Translation of

Html-string from=20

$str =3D "

This is a title>

test
";


To a string that is like:



This is a title

Test





?

Best regards
/Gustav Wiberg

--=20
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: Translation of html?

am 18.06.2007 16:43:33 von php

strip_tags($string); removes all html from any string, but won't put in
any spaces so you'd get:

This is a titletest

Mike


Gustav Wiberg skrev:
> Hi there!
>
> Ok, thanx! Then I'll know!
>
> Best regards
> /Gustav Wiberg
>
> -----Original Message-----
> From: Bill Bolte [mailto:billb@hightouchinc.com]
> Sent: Monday, June 18, 2007 4:32 PM
> To: php-windows@lists.php.net
> Subject: RE: [PHP-WIN] Translation of html?
>
> There isn't anything built in to PHP to do this but one could do it with
> Regular Expressions. You might check through the Pear libraries or the
> PHP classes website for functions/classes already built.
>
> -----Original Message-----
> From: Gustav Wiberg [mailto:gustav@hmn.se]
> Sent: Monday, June 18, 2007 9:23 AM
> To: 'php windows' (php-windows@lists.php.net)
> Subject: [PHP-WIN] Translation of html?
>
> Hi there!
>
> Is this possible? I can't find any functions for this (I don't exactly
> what to search for)
>
>
> Translation of
>
> Html-string from
>
> $str = "

This is a title>

test
";
>
>
> To a string that is like:
>
>
>
> This is a title
>
> Test
>
>
>
>
>
> ?
>
> Best regards
> /Gustav Wiberg
>
>

--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: Translation of html?

am 18.06.2007 16:48:32 von phpml

Gustav Wiberg wrote:
> Hi there!
> Is this possible? I can't find any functions for this (I don't exactly what to search for)
>
> Translation of Html-string from
> $str = "

This is a title>

test
";
>
> To a string that is like:
> This is a title
> Test


This class converts HTML to plain, formatted ASCII text. By default, the
text is wrapped to 70 characters, and some basic formatting is applied
to preserve some of the HTML formatting. Some examples:

* Paragraphs are indented
* Heading tags

-

are all caps
* Horizontal lines,
, are converted to hyphens
* Links are preserved as a footnoted list at the end
http://chuggnutt.com/html2text.php

Regards,
=dn

--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

RE: Translation of html?

am 19.06.2007 08:01:00 von Gustav Wiberg

Hi!

Aha, thanx! This might work. Thank you!

Best regards
/Gustav Wiberg
=20

-----Original Message-----
From: Mikael Grön [mailto:php@emgee.se]=20
Sent: Monday, June 18, 2007 4:44 PM
To: 'php-windows@lists.php.net'
Subject: Re: [PHP-WIN] Translation of html?

strip_tags($string); removes all html from any string, but won't put in=20
any spaces so you'd get:

This is a titletest

Mike


Gustav Wiberg skrev:
> Hi there!
>
> Ok, thanx! Then I'll know!
>
> Best regards
> /Gustav Wiberg=20
>
> -----Original Message-----
> From: Bill Bolte [mailto:billb@hightouchinc.com]=20
> Sent: Monday, June 18, 2007 4:32 PM
> To: php-windows@lists.php.net
> Subject: RE: [PHP-WIN] Translation of html?
>
> There isn't anything built in to PHP to do this but one could do it with
> Regular Expressions. You might check through the Pear libraries or the
> PHP classes website for functions/classes already built.=20
>
> -----Original Message-----
> From: Gustav Wiberg [mailto:gustav@hmn.se]=20
> Sent: Monday, June 18, 2007 9:23 AM
> To: 'php windows' (php-windows@lists.php.net)
> Subject: [PHP-WIN] Translation of html?
>
> Hi there!
>
> Is this possible? I can't find any functions for this (I don't exactly
> what to search for)
>
>
> Translation of
>
> Html-string from=20
>
> $str =3D "

This is a title>

test
"=
;
>
>
> To a string that is like:
>
>
>
> This is a title
>
> Test
>
>
>
>
>
> ?
>
> Best regards
> /Gustav Wiberg
>
> =20

--=20
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php