Jump to content

Recommended Posts

Another question so soon? yes!

 

I need to parse through text that was entered by the user to find two words in a row, "Dealt to"

 

so i find the "dealt to" line and after that is a word which I would like to change the color of.

for example:

Dealt to CheeseMan [X Y] // I would like to A) find this line b)change the text of 
//CheeseMan to blue C) represent X with x.jpg and y with y.jpg

 

thanks again for all of your help!

Link to comment
https://forums.phpfreaks.com/topic/53106-search-for-string/
Share on other sites

when I use strpos:

 

$pos = strpos($ph, $findme);

 

I am returned with the character's number. How do I go about editing the characters after that number?

 

example:

 

$pos returns 100, how do I go about editing character number 102?

 

or at least how do I get the string that starts at the "D" in dealt to and ends with the "[" in [X Y]

 

Thanks again

Link to comment
https://forums.phpfreaks.com/topic/53106-search-for-string/#findComment-262333
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.