> I've been RTFMing for about an hour and I can't find a string function 
> to split haystack 'one<br>two<br>three<br>four<br>five' at the nth 
> occurrence of needle '<br>'. strpos gives me the position of the first 
> needle, and strrpos gives me the position of the last needle. But I'm 
> looking for the position of one of the in-between needles, so that I 
> can use substr() to trim everything from there on. What very obvious 
> function was I unable to find in the manual?

You could use explode().

<?
  $string = 'one<br>two<br>three<br>four<br>five';
  $nthPos = 4;

  $tmpArr = explode( '<br>', $string );
  $nthString = $tmpArr[($nthPos - 1)];
?>

Chris

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to