Adding to an empty array if word is found in two set of texts

Ok SO you’re using the entire code or just the array of colors in the php page?

Just loading the necessary $colors array.

I added a word “pride” in the 1st text and it didn’t highlight it.

I have modified the online “text-001.php” file and added pride near the very top.

It is not highlighted because it only appears in “text-001.php” and not in “text-002.php”.

If this is not what is required then please supply further instructions.

Yes you’re right. I added “pride” in the 2nd text as well. I also added “proud”. But I noticed the color was different between them. It did highlight them both.

One thing I forgot to mention, this might be quite a challenge. Let’s say “pride” appears in one text and proud appears in the 2nd text, I would like to see them both highlighted with the same color. Even if “pride” isn’t found in the 2nd text but “proud” is found.

I think the additional feature you have remembered would be better if created in a new topic. Reason for the new topic is not to confuse this provided solution which appears to be working satisfactorily after exhaustive testing.

In the new topic please also supply the script you have tried which does not solve the problem.

1 Like

ok I posted as a new topic

2 Likes

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.