I want to search word within a string by equidistant letters pattern:
Example I want to search love within the x’s at a skip of 3 letters or every 4th letter:
xxxlxxxoxxxvxxxexxx
My logic is that first I need to explode the keyword:
str_split($keyword);
But I’m not sure afterward. But it’s not splitting the into hebrew letters, rather a black diamond shape with a ?.
So far I have this:
unless I’m misunderstanding something, why can’t you just explode the string using ‘xxx’ as the delimeter and then concatenate every 2nd element of the returned array, if it is a letter, to get the embedded word?
Now you have changed the criteria in which words can be embedded in the x’s. In your op the letters were spaces a constant 3 x’s apart and your thread title says the letters are equidistant.
Now you are showing the embedded words can overlap each other and that the letters don’t have to be equidistant apart. There’s too much uncertainty in your posted criteria so I think I’ll leave this one alone.
This looks like code to do a crossword puzzle. To verify that a word doesn’t appear twice in a string. But you have letters between your letters? Maybe you can instead explode the search term into individual letters and then search your xxxlxxxoxxxvxxleoxvxex string for each time an l appears if an o appears after then check if a v appears after, etc…
that’s right like a crossword puzzle. I pretty much figured it out, that the text given is split up into a huge array of letters. And the search ought to look for two letters at a certain number apart and try to match another latter with the same number otherwise it should skip or exit and continue with a new search.
Take a look at my website: http://www.gbgrafix.com/thewheelofgod/bible-code-search/
When you make your selections either type in a word in hebrew by using the keyboard which opens upon clicking in the one of the textareas on the left.
Or select the book and chapter and select a word and drag and drop in the textarea and click the same chapter to refresh it.
I’ve tried to figure out if every letter will be made bold and red which are found in the keyword but it didn’t. It made some of the bold and red in the table.
the Keyword(s):
$into_alephbet reconverts the english letters of the keyword into hebrew with str_replace();
$chap_heb_letters are all the hebrew letters in the chapter. My intention of writing the last for loop is that I wanted (to begin with) to see if all the letters of the keyword would be colored red in the grid.
But I intend to search if there’s any match of equidistant hebrew letters of the keyword(s) in the given hebrew text.
What I’m looking for is that I want to search a $keyword like love within the string.
My logic is that I have to break the string into an array of letters;
break the $keyword into and array of letters
create a for loop to search
make the array of the count($keyword)*$i not exceed the count($string) else exit the loop
here’s where I find tricky: I need to match all the letters of the keyword to the letters of the string at the given equidistant letter sequence or $els which is a variable, or maybe use the $i from the for loop instead.
I have a question about the if statement:
can i bring in an array within the if brackets:
if($kw[$k]==$str[$i] && $kw[$k]==$str[$i]...depending at the number of $key){
...}
Your function doesn’t work. Sure it seems to be working because it colors “love” in the string, but if you only have L, O and V in the string (no E) it will also color LOV, and that’s not supposed to happen. It should color the whole word or nothing at all.