This is very confusing.
I have developed some code to search through a string that is actually an element in an array, e.g. $my_array[1]
If I assign a value to my_array[1] in a simple php programme and do some pattern searches, I get the results I expect. Like this.
$my_array[1] = "HELLO THERE WORLD";
$pos = strpos(my_array[1], " THERE ");
pos will have the value of 5 for the beginning of the word " THERE ". Note the space at the front of THERE. I need to check for this complete string.
My aim is to change some code in an applicaiton.
The code is in a class, called say my_class()
The variable my_array[1] is assigned a value and I can print it out and see it, but my problem is that when I try and perform a test on the string like in the example above it fails to see the pattern. This is even though the string in my_array[1] does contain the pattern I am looking for and is in the right case.
Also, if I physically assign anything with the pattern I'm looking for to my_array[1] just before I check it with strpos() it finds the value.
Is there something I'm missing here?
The Drummer.