Jump to content


Photo

What would be the best to use for..


  • Please log in to reply
3 replies to this topic

#1 presso

presso
  • Members
  • PipPip
  • Member
  • 11 posts

Posted 12 October 2006 - 04:54 AM

Hey all , i am doing a little project at the moment and i am just wondering what would be the best way to go about doing the following.

I query sql for certain info , the info that returns is say  a block of text, what i am looking at wanting to do is to stop display when it sees a certain tag, ie a block of text and within that text is <!stop> , when it see's that it won't display anything beyond that tag.

If somebody could point me in the right direction i would be most grateful.

#2 Firemankurt

Firemankurt
  • Members
  • PipPipPip
  • Advanced Member
  • 56 posts
  • LocationWashington State

Posted 12 October 2006 - 06:33 AM

If you want to do this after the query then something like:
<?php
$mystring = 'This is a long block of usles text <!stop> that goes on forever.';

$findme  = '<!stop>';
$pos = strpos($mystring, $findme);

$ShortStr = substr($mystring, 0, $pos);

echo $ShortStr;
?>



#3 presso

presso
  • Members
  • PipPip
  • Member
  • 11 posts

Posted 12 October 2006 - 06:51 AM

Perfect , Thats just what i was after , Many Many thanks  ;D

#4 Firemankurt

Firemankurt
  • Members
  • PipPipPip
  • Advanced Member
  • 56 posts
  • LocationWashington State

Posted 12 October 2006 - 06:53 AM

Glad I could help
;D




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users