Log in

View Full Version : help with string functions



sukanya.paul
01-19-2009, 11:18 AM
hi,
i have a huge string in which many words are repeated. i want to find all the positions of a particular word and then echo from the position to end of line.can you please help me do this.

eg:
$text= name: sukanya
age= 25
city= bangalore
company name= xyz

now when i search with name i want the positon of both the names and i want to type
name= sukanya &
name= xyz

thanks in advance,
Suk

davewylie
01-19-2009, 01:49 PM
Hi,

Sounds liek you really need to load your data into a database, then it should be easy to retrieve the information you want.;)

sukanya.paul
01-20-2009, 08:19 AM
hi,
i wish it was that simple. the string comes from a word document. i basically have to parse word documents and retrieve information from there. am not allowed to use COM so have to do it with fread.
not a very easy task. i have managed to asign the word doc content as a string and also managed to remove most of the special characters those get displayed in the browser(except table tags- help will be appreciated here too).
but then rest is where i am stuck.
can someone show me the right direction?
Thanks,
Suk

npsari
01-21-2009, 11:44 PM
You can do it very easily using PHP


Try this page

http://www.zortin.com/scripts/show/?id=41