Hi all.
I’m trying to echo a variable followed by a link and Dreamweaver’s code hinter keeps flagging it up as an error.
The variable is $truncated which takes a string and shortens it to 130 characters or less (without cutting in the middle of a word). This is the $truncated variable.
$truncated = substr($longstring,0,strpos($longstring,' ',130));
And now I want to create another variable that takes the shortened text and adds a “Read More” link afterwards…
I’m doing it like this:
$msg = echo($truncated "<a href='http://ivegotkids.com/aries'>Read More</a>");
Dreamweaver keeps on telling me that last line is incorrect.
I have also tried it with a comma after $truncated…
$msg = echo($truncated, "<a href='http://ivegotkids.com/aries'>Read More</a>");
I have also tried it by putting the link in a separate variable called $url and echoing both like this:
$msg = echo($truncated, $url);
I have also tried all three of the above without the brackets.
What should it be?