I have a problem that is kicking my ass for a couple of days now.
I have an array of strings and each string contains a single hebrew word.
These words where ripped from a PDF and appear in the array in the same order as shown in the PDF.
I want to take these words and reconstruct them into a sentence in the order they are in the array and the PDF. Seems very simple.
edit: Here is the code, its actually XML I'm looping through, I think its irrelevant but since I'm showing the code I better have it right :)
foreach($text->TOKEN as $word) {
$sentence = $sentence . ' ' . $word;
}
/*
This sentence will sometimes (not always) not have the same order as the XML.
Hebrew is read right to left but thats not the issue, I just want to make a
string in the same order as the words.
*/
echo $sentence;
Its like the words have a mind of their own and the order gets jumbled up to what does not seem like a logical order to a non Hebrew reader. Commas will move around to different words even. But this is not always the case.
I do not read or speak Hebrew but from what I can gather there are some special characters in the language that might be affecting the order? My question is what do I have to do to strip them out?
I'm using PHP for this.