View previous topic :: View next topic |
Author |
Message |
red
![](images/avatars/242328301439ed761a6053.gif)
Joined: 03 May 2004 Posts: 919 Location: Zabok
|
Posted: 15.06.2004 19:42 Post subject: PHP skripta za skraćivanje teksta |
|
|
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](images/smiles/icon_smile.gif) |
|
|
Back to top |
|
![](templates/subSilver/images/spacer.gif) |
Sulien
![](images/avatars/116771498344a191023de11.png)
Joined: 04 Jan 2004 Posts: 2905 Location: Zagreb
|
|
Back to top |
|
![](templates/subSilver/images/spacer.gif) |
_butch
![](images/avatars/12164917223f5f9b8abb84f.gif)
Joined: 10 Sep 2003 Posts: 870 Location: Maichno, Krlovc
|
Posted: 15.06.2004 20:15 Post subject: |
|
|
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](images/smiles/icon_biggrin.gif) |
_________________ 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 |
|
![](templates/subSilver/images/spacer.gif) |
red
![](images/avatars/242328301439ed761a6053.gif)
Joined: 03 May 2004 Posts: 919 Location: Zabok
|
Posted: 15.06.2004 20:21 Post subject: |
|
|
Sjajno, bajno. Thnx. |
|
|
Back to top |
|
![](templates/subSilver/images/spacer.gif) |
Sulien
![](images/avatars/116771498344a191023de11.png)
Joined: 04 Jan 2004 Posts: 2905 Location: Zagreb
|
Posted: 16.06.2004 11:43 Post subject: |
|
|
Najbrži typo in the west
@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 very useful
http://www.php.net/download-docs.php |
|
|
Back to top |
|
![](templates/subSilver/images/spacer.gif) |
|