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.
And now I want to create another variable that takes the shortened text and adds a "Read More" link afterwards...PHP Code:$truncated = substr($longstring,0,strpos($longstring,' ',130));
I'm doing it like this:
Dreamweaver keeps on telling me that last line is incorrect.PHP Code:$msg = echo($truncated "<a href='http://ivegotkids.com/aries'>Read More</a>");
I have also tried it with a comma after $truncated...
I have also tried it by putting the link in a separate variable called $url and echoing both like this:PHP Code:$msg = echo($truncated, "<a href='http://ivegotkids.com/aries'>Read More</a>");
I have also tried all three of the above without the brackets.PHP Code:$msg = echo($truncated, $url);
What should it be?



Reply With Quote





Bookmarks