-
Sorry for the long reply again Jas, had to put this on hold for a few days as work has asked of me all the hours God sends!!! Finally finished for the weekend!! So back to this.....
Have never heard of "concat", looking at your example, I think I get what it means. But it doesn't seem to be helping me!! It hasn't changed the output at all. Output on screen is still perfect, just the text in the created file is wrong.
Here's what it puts in file....
PHP Code:
username:password<br>username:password<br>
So that's everything on 1 line. The <br> should not be there at all. This should be indicating a new line needs to be started.
Any more ideas?!?!?
Thanks again, and sorry again for the long reply. I just have been so tired after work to even attempt to look at this until now!!
Smithster.
-
'<br>' is only a newline when it is read by the browser, the browser recougnizes it as html and displays it as such. in a file '<br>' means the accual text "<br>" ('<' with a 'b' then an 'r' and a '>'). try replacing '<br>' with '/n'
sorry for the misspellings
-
Thanks Master_script_maker, but unfortunately it does almost the same thing except it does this....
PHP Code:
username:password/nusername:password/n
-
don't use use Notice the difference in the slash. This / is a character, this \ is an operator. :) Your OS might want a \r instead, if that doesn't work.
-
Here is what I have tried...
PHP Code:
$content .= ''.preg_replace('/[\r\n]/','',$names[$i]).':'.crypt(preg_replace('/[\r\n]/','',$passwords[$i]),base64_encode).'\n';
PHP Code:
$content .= ''.preg_replace('/[\r\n]/','',$names[$i]).':'.crypt(preg_replace('/[\r\n]/','',$passwords[$i]),base64_encode).'/n';
PHP Code:
$content .= ''.preg_replace('/[\r\n]/','',$names[$i]).':'.crypt(preg_replace('/[\r\n]/','',$passwords[$i]),base64_encode).'\r';
And Here is the output of each one...
PHP Code:
user:password\nuser:password\n
user:password/nuser:password/n
user:password\ruser:password\r
Each one in the output has slashes by the way, for some reason the phpcode thing omits them!
-
I don't know why, but for some reason you have to use double quotes ( " ) in order for \r\n characters to work right. You may want to try that.
PHP Code:
$content .= preg_replace('/[\r\n]/','',$names[$i]).":".crypt(preg_replace('/[\r\n]/','',$passwords[$i]),base64_encode)."\r\n";
Hope this helps.
-
Thank you!!! This has been bugging me for a very long time!!! Finally it is now working properly.
Thank you to Jas and to thetestingsite for all your help on this.
Smithster.
-
That is a really odd bug. I'll have to keep that in mind myself. Thanks thetestingsite.