Stukje PHP/HTML combineren

Gestart doorOne2xs2 reacties29 weergaven

3 berichten · pagina 1 van 1

One2xs

Bot · Topicstarter

Berichten
93.699
Reputatie
0
Punten
1,27
Lid sinds
Laatst gezien
Ongetwijfeld een heel simpel vraagje, maar ik kreeg het zo niet voor elkaar. Ik heb een read-more functie in een blog script van mij. Nou wil ik deze alleen op een andere manier weergeven, namelijk als tekst ipv. button.

De huidige code om de read-more button te weergeven;

<a href="[COLOR= #0000BB]<?php[/COLOR] [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #0000BB]$url[/COLOR][COLOR= #007700].[/COLOR][COLOR= #DD0000]post/[/COLOR][COLOR= #007700].[/COLOR]make_post_link[COLOR= #007700]([/COLOR][COLOR= #0000BB]$row[/COLOR][COLOR= #007700][[/COLOR]id[COLOR= #007700]]).[/COLOR][COLOR= #DD0000]-[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$row[/COLOR][COLOR= #007700][[/COLOR]id[COLOR= #007700]];[/COLOR] ?>">[COLOR= #0000BB]<?php[/COLOR] [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #0000BB]$lang[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]read_more[/COLOR][COLOR= #007700]];[/COLOR] ?></a>


Het moet in het volgende stukje code komen, op de plek van lees verder

$content = (strlen($content) > 103) ? substr($content,0,100). <a href="">Lees verder...</a> : $content;
echo $content;


Iemand die mij hiermee op weg kan helpen?

Alvast bedankt!.
0
One2xs

Bot · Topicstarter

Berichten
93.699
Reputatie
0
Punten
1,27
Lid sinds
Laatst gezien
[COLOR= #0000BB]<?php
$content[/COLOR] [COLOR= #007700]= ([/COLOR][URL="http://www.php.net/strlen"]strlen[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$content[/COLOR][COLOR= #007700]) >[/COLOR] [COLOR= #0000BB]103[/COLOR][COLOR= #007700]) ?[/COLOR] [URL="http://www.php.net/substr"]substr[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$content[/COLOR][COLOR= #007700],[/COLOR][COLOR= #0000BB]0[/COLOR][COLOR= #007700],[/COLOR][COLOR= #0000BB]100[/COLOR][COLOR= #007700]).[/COLOR][COLOR= #DD0000] <a href="[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$url[/COLOR][COLOR= #007700].[/COLOR][COLOR= #DD0000]post/[/COLOR][COLOR= #007700].[/COLOR]make_post_link[COLOR= #007700]([/COLOR][COLOR= #0000BB]$row[/COLOR][COLOR= #007700][[/COLOR]id[COLOR= #007700]]).[/COLOR][COLOR= #DD0000]-[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$row[/COLOR][COLOR= #007700][[/COLOR]id[COLOR= #007700]].[/COLOR][COLOR= #DD0000]">[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$lang[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]read_more[/COLOR][COLOR= #007700]].[/COLOR][COLOR= #DD0000]</a>[/COLOR] [COLOR= #007700]:[/COLOR] [COLOR= #0000BB]$content[/COLOR][COLOR= #007700];[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #0000BB]$content[/COLOR][COLOR= #007700];[/COLOR]
0
One2xs

Bot · Topicstarter

Berichten
93.699
Reputatie
0
Punten
1,27
Lid sinds
Laatst gezien
Zo simpel kan het zijn, thanks Jesse!
0

Jouw reactie

Deel je idee, stel een vraag of help een ander verder.

Editor laden…

Praat mee met de One2xs-community.

Inloggen om te reageren