|
Posted by programmo@gmail.com on 03/17/07 22:11
On 17 Mar, 20:22, "progra...@gmail.com" <progra...@gmail.com> wrote:
> I need to divide in two string an article, to split in more pages:
>
> I have this string:
> [page]
> <hello word>
> [/page]
>
> [page]
> <hello word2>
> [/page]
>
> I need to split in array to show my article in more pages.
> I want an array that show already indexed for every page, so I use
> foreach and get and show the page.
>
> How the best and speed method to make this?
>
> www.pierpaoloromanelli.com
Thanks I solved in this method:
if($data['Article']['paged']==true)
{
if (isset($_GET['pag']))
$pagenumber=($_GET['pag']);
else
$pagenumber=1;
$Pieces= explode("[newpage]", $data['Article']['body']);
$data['Article']['pagine']=count($Pieces);
$data['Article']['body']=$Pieces[$pagenumber-1];
}
Navigation:
[Reply to this message]
|