ok I got a little bit of some code, ive found and played with
<?
function get_string($h, $s, $e)
{
$sp = strpos($h, $s, 0) + strlen($s);
$ep = strpos($h, $e, 0);
return substr($h, $sp, $ep-$sp);
}
$haystack = 'please <a href="http://www.yourcompany.com/manual/doc/notes/add-note.php">[url]http://www.yourcompany.com/manual/doc/notes/add-note.php2[/url]</a> now';
$start = '">';
$end = '</a>';
$found = get_string($haystack, $start, $end);
echo $found;
?>
this seems to work as of finding the links thats in between a href and /a
now how would one take that link and shrink it...I tried this but its not printing on the screen.
function limit_text( $text, $limit )
{
// figure out the total length of the string
if( strlen($text)>$limit )
{
# cut the text
$text = substr( $text,0,$limit );
# lose any incomplete word at the end
$text = substr( $text,0,-(strlen(strrchr($text,' '))) );
}
// return the processed string
return $text;
}
only problem with above is it will only find one url string, so if there are multi url strings in the one string it will only post one