Forum FAQForum FAQSearchSearch MemberlistMemberlist Forum ignore listForum ignore list RegisterRegister ProfileProfile Log in to check your private messagesLog in to check your private messages Log inLog in
PHP skripta za skraćivanje teksta

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    mi3dot.org Forum Index -> Server-side
View previous topic :: View next topic  
Author Message
red



Joined: 03 May 2004
Posts: 919
Location: Zabok

PostPosted: 15.06.2004 18:42    Post subject: PHP skripta za skraćivanje teksta Add user to your forum ignore list Reply with quote

Treba mi neka PHP skripta koja bi mi skratila unešeni dugi tekst ili URL na način da ne ispiše cijelu rečenicu ili URL već samo dio, nakon čega bi se ispisale tri točke. Nešto slično pretpostavljam ima ođe na njuz sistemu, samo su te tri točke u sredini URL-a. Tražio bi na guglu al fakat ne znam kakav srč da pokrenem Smile
Back to top
View user's profile Send private message Visit poster's website Twitter profile
Sulien



Joined: 04 Jan 2004
Posts: 2905
Location: Zagreb

PostPosted: 15.06.2004 19:14    Post subject: Add user to your forum ignore list Reply with quote

To je barem easy...

http://www.php.net/manual/en/function.substr.php

Code:
$string = substr($string,0,10) . "...";

To ti je prvih deset znakova + tri točke
Back to top
View user's profile Send private message Send e-mail Visit poster's website
_butch



Joined: 10 Sep 2003
Posts: 870
Location: Maichno, Krlovc

PostPosted: 15.06.2004 19:15    Post subject: Add user to your forum ignore list Reply with quote

Code:

<?php
$string = "Ovo je test njuz. blablablabla";

// Koliko znakova ima "recenica"
$znakovi = strlen($string);

// Sad mozes staviti ako ima vise od recimo 14 znakova da ti skreti
if ($znakovi  > '14') {

$string = substr($string, 0, 14);
$string = $string.' ...';
}

echo $string;
?>

@Sulein - damn u !!1 brz si Very Happy

_________________
FRENCH GUARD: No chance, English bed-wetting types.
I burst my pimples at you and call your door-opening request a silly thing, you tiny-brained wipers of other people's bottoms!
Flikrac
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
red



Joined: 03 May 2004
Posts: 919
Location: Zabok

PostPosted: 15.06.2004 19:21    Post subject: Add user to your forum ignore list Reply with quote

Sjajno, bajno. Thnx.
Back to top
View user's profile Send private message Visit poster's website Twitter profile
Sulien



Joined: 04 Jan 2004
Posts: 2905
Location: Zagreb

PostPosted: 16.06.2004 10:43    Post subject: Add user to your forum ignore list Reply with quote

Najbrži typo in the west Cool Bang!

@red: sve možeš naučiti iz manuala, a imaš i za downloadat php manual u CHM obliku (kao help fileovi) pa imaš sve na disku i možeš nabacit searh Arrow very useful

http://www.php.net/download-docs.php
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    mi3dot.org Forum Index -> Server-side All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group