Folk,
The task is to grab a web page, strip the HTML tags, and save it as a text file. Kind of a reverse CMS.
The problem is converting the br tags back into line breaks. I can't find a PHP function that does it, so I've tried str_replace(), but to no avail. I.E.,
[red]str_replace("<br />",xxx,$body)[/red] where [red]xxx[/red] is any of the items listed below. None of 'em worked <sigh />.
I've tried [red]chr(10)[/red] and [red]chr(13[/red]) alone and in tandem. I've tried [red]0x0A[/red] and [red]0x0D[/red] alone and in tandem. I've tried [red]\n[/red] and [red]\r[/red] alone and in tandem, quoted and unquoted. I've tried assigning each of these to the variable [red]$cr[/red], just for grins, when they didn't work directly, i.e.,
[red]str_replace("<br />",$cr,$body)[/red].
Does anyone have any idea how this might be done with a PHP script?
TIA,
make a good day . . .
. . . barn
The task is to grab a web page, strip the HTML tags, and save it as a text file. Kind of a reverse CMS.
The problem is converting the br tags back into line breaks. I can't find a PHP function that does it, so I've tried str_replace(), but to no avail. I.E.,
[red]str_replace("<br />",xxx,$body)[/red] where [red]xxx[/red] is any of the items listed below. None of 'em worked <sigh />.
I've tried [red]chr(10)[/red] and [red]chr(13[/red]) alone and in tandem. I've tried [red]0x0A[/red] and [red]0x0D[/red] alone and in tandem. I've tried [red]\n[/red] and [red]\r[/red] alone and in tandem, quoted and unquoted. I've tried assigning each of these to the variable [red]$cr[/red], just for grins, when they didn't work directly, i.e.,
[red]str_replace("<br />",$cr,$body)[/red].
Does anyone have any idea how this might be done with a PHP script?
TIA,
make a good day . . .
. . . barn