Jump to content

Trying to get info between two strings of text


chris_2001

Recommended Posts

I have a string of text and I need to get what is in the middle of two specific things

 

 

Hello *wiki black end* everyone!

 

Using the above as an example how would I get php to get only black? Both the words Hello and everyone! will change to random things input by the user.

Literally anything with some of these tags

 

*vocab
*def
*wiki
*english
*spanish
end*

 

They are always ended with end*. I want to get the information between the beginning tag (*def etc.) and the end* tag.

 

Here are some random examples.

 

The light of a *wiki black light end* is a weird one

 

In this case I am trying to get "black light" out of the string.

 

*spanish la tarea end*

 

la tarea in this example

 

the first *vocab ionization energy end* is 1923kJ/mol

 

and in this case ionization energy. If you need anything else let me know.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.