@Tiffany yeah I was trying to find the bug which was causing it, I was using steam wrapper to upload to some remote location and I was handling maximum timeout, by recalling the script so when I was recalling the script then the stream used to close, that's what I wanted to ask if when script dies does it calls fclose if any file is fopen
hello guys can anyone tell me how to solve exporting data to csv file when the file has special cherecters ?
in my case it is hebrew charecters
I wrote a php code to export data to CSV file but data exported that includes Hebrew characters are showing as gibberish Here is my code https://pastebin.com/D7e492Hv And here is how it is showing after being exported https://ibb.co/jzSpqmJ
If the source data isn't encoded as Unicode, try to figure out what encoding it is, there are mb_ functions that can help but there are a couple of edge cases where they fail detection. Once you know the source encoding, re-encode to Unicode, then export to CSV, but make sure that when it's exported, it's exported as Unicode, and the CSV is encoded as Unicode
Make sure your database is encoded as UTF-8 as well
I am struggling with this issue for few days now, reading and trying whatever I came across with no solution found:
Here is the bottom line of what I want to do: I have a members only system. when a member posts a message on the message board all others get notification by email. Simple.
I use th...
> I would find it highly concerning if fn() => X and fn() => { return X; } had differences in capture semantics.
@NikiC did you mean that just in relation to the 'this' shenanigans, or more widely, so you'd be against requiring something like use(*) to trigger auto-capture for multi-line short closures?
Using fn and function for that is terrible I will bet my hand that at one point someone somewhere is going to decide to want a consistent function style and always use fn and then get confused
Or they have a by-ref use and complain that it's ugly they can't use fn and it should cater to that
@Crell as I said on list, I don't think anyone thinks of "fn" as being a particularly important keyword right now; they talk about "arrow functions", and if asked to read it out would probably pronounce "fn" as "function" and not think about the difference
so saying "fn already means that" is... stretching the truth, IMO
we should probably have made fn a synonym of function straight away, because that's all it was ever supposed to mean
function() => $x as auto-capturing, function() { return $x; } as not
it honestly never occurred to me before this RFC that "fn" meant anything other than "function, but when you can't be bothered to type all the letters"
I think you should be careful what you wish for with the => as auto capturing because there's a not entirely unreasonable chance that at some point the tide will turn for short functions.
Then again I think most of those usages were probably more related to getters and setters
As far as making fn and function identical, then we need some way to flip auto-capture on and off that is consistent with both the existing syntaxes. And... I don't know how we do that.
Named functions, yes. Closures already have capturing.
(Since you implied it on the list, in hindsight I think it would have been better had we skipped manual capture entirely. My recollection is a lot of people concerned about the mess that is Javascript, but in practice I think by-value capture resolves 90% of those issues anyway.)
Because ergonomically we want the language to be predictable? We could debate what qualifies as predictable, no doubt, but the implications of certain syntax usages should be "oh, yeah, that's what I'd expect it to do" or "ah, that makes sense now that I see it". Not "well, that's weird, but... whatever."
(Yes, those are all subjective, but hopefully we can agree on that as a heuristic goal.)
maybe I'm influenced by experiencing the discussion leading up to fn() => $x; if we'd stuck with () ~> $x or () ==> $x or \() => $x, I don't think we'd be having the same discussion