Thursday, July 29, 2010

Cut Paragraph Into Specific Number of Words in PHP

php

Di bawah ini merupakan script PHP untuk memotong paragraf atau konten kalimat di web.

<php
function Cut_Words($sentence,$word_count)
{
$space_count = 0;
$print_string = '';
for($i=0;$i
{
if($sentence[$i]==' ')
$space_count ++;
$print_string .= $sentence[$i];
if($space_count == $word_count)
break;
}
echo $print_string;
}

$sentence = 'Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo. Nemo enim ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos qui ratione voluptatem sequi nesciunt. Neque porro quisquam est, qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit, sed quia non numquam eius modi tempora incidunt ut labore et dolore magnam aliquam quaerat voluptatem. Ut enim ad minima veniam, quis nostrum exercitationem ullam corporis suscipit laboriosam, nisi ut aliquid ex ea commodi consequatur? Quis autem vel eum iure reprehenderit qui in ea voluptate velit esse quam nihil molestiae consequatur, vel illum qui dolorem eum fugiat quo voluptas nulla pariatur?';

Cut_Words($sentence,13);

?>

To call the function just write Cut_Words($sentence,13). It means to cut text into 13 words.

SKKNI

skkni

skkni


SKKNI is one of many web projects that I developed with PHP and MYSQL and it was implemented DEPNAKERTRANS RI directorate. This web content was filled with news information, event information and online document management. This web divided into two sections, User Section and Administration Section.
User section was filled with profile information, news information, event information, documents, forum and email. Administration section was filled with administration management. This web is using ExtPlorer component for document management.

skkni

Ciputra Mall

ciputra mall


Ciputra Mall is one of many web projects that I developed with PHP and MySQL. Content of web was filled with Jakarta Ciputra Mall advertisement. There are two sections, user and administration section. This website content was divided into English and Indonesian.
User Section was filled with profile information, management information, facility information, service information, award information, leasing information, FAQ, Job Vacancy, Magazine, Event, Gallery, Directory, Tenant, Questionnaire, Forum and Newsletter. Administration Section was filled with User Section content administration. This website use open source facility like PHPBB for forum, AJAX gallery and Cron process for realtime data checking.