Posted
about 13 years
ago
by
Alex
Nice work so far; I have found just a little bug: If a line is exactly as long as str_length, the space will be carried to the next line and will cause an indentation of the following line.
|
Posted
about 13 years
ago
by
Weldan Jamili
//Require file_get_contents.js
function is_readable(file) {
var _file = file_get_contents(file);
if (_file) {
var _length1 = _file.replace("<h1>Object not found!</h1>", "LOL", _file);
var _length2 = _file;
|
Posted
about 13 years
ago
by
masharblem
|
Posted
about 13 years
ago
by
Pete
I think checking if cls is 'undefined' is reasonable, and if it is, then the function should also return false.
if(typeof cls === 'undefined'){
return false;
}
|
Posted
about 13 years
ago
by
Haider Abbas
Thanks a lot! Works just like PHP equivalent. Perfect work. Very helpful.
|
Posted
about 13 years
ago
by
Brett Zamir
@Anum: You mean it is giving you the string "[object Object]" as output, or you are expecting an object? This should be converting a properly serialized string into an object. If you are getting the string, do you have sample code?
|
Posted
about 13 years
ago
by
Brett Zamir
@Jaroslaw Czarniak: I have fixed this in Git. Hopefully we can keep this function (and all others) friendly to UTF8 which everyone should be using now anyways.
|
Posted
about 13 years
ago
by
Friv
Cool code.
Many thanks!
|
Posted
about 13 years
ago
by
Matteo
I do not know if this can help, but I noticed this:
date('Y-m-d', strtotime('2012-07-01 +7 DAY')) = 2012-07-11 --> wrong
but
date('Y-m-d', strtotime('+7 DAY', strtotime('2012-07-01'))) = 2012-07-08 --> correct
|
Posted
about 13 years
ago
by
Gryffyn
A couple people mentioned the .toFixed(precision) but I overlooked them because they didn't mention the specific problem I was having (or at least not with the keywords I was searching the page for).
Basically I wanted to display money values in a
|