You are here: Re: Split and divide a string searching a bbcode « PHP Programming Language « IT news, forums, messages
Re: Split and divide a string searching a bbcode

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]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация