I need to generate random sentences from the dictionary. Each word in the dictionary is in a line, first I Loading in the array and after that I have some random data pickup for the cycle, but if I wrote it, then it is on the line in the browser, but the source code is in the other word, every word again I'm one of the search engines A set of SMML files will be created and it is indexing new lines as / n / r
and in the XML source code it is a symbol & amp; #xD;
So my question is how can I create a sentence that will also be in the line in the source code thanks.
Here is a piece of my code that is not loading data here randomly, it's made for illustration for the cycle only.
$ file = fopen ("Test.txt", "r"); $ Data = array (); While (($ buffer = fgets (file $)! == incorrect) {$ data [=] = $ buffer; } $ Sentence = ''; ($ I = 0; $ i & lt; 10; $ i ++) {$ sentence = $ sentence $ data [$ i]; }
Use the function to filter the new line character. Your code should be used:
$ data [] = trim ($ buffer);
No comments:
Post a Comment