Re: Showing only part of string

From: Date: Fri, 07 May 2004 10:24:18 +0000
Subject: Re: Showing only part of string
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-185600@lists.php.net to get a copy of this message
I guess the easiest way to do this would be to use a regular expression: if (preg_match("/<title>(.*)<\/title>/i", $string, $m)) { $found = $m[1]; } echo $found; Richard Friday, May 7, 2004, 12:11:02 PM, thus was written: > Hi List, > $string = "This is a test string to <title>SHOW ONLY THIS BIT</title> of the > string"; > I have tried strpos, str_replace and other string manipulation things but I > cant get my head around how to achieve showing the text with the > <title></title> tags of the string. > Any help is appreciated and I thank you in advance for any help given. > Thank you > Dave Carrera

« previous php.general (#185600) next »