logs archiveIRC Archive / Freenode / #php / 2015 / July / 12 / 1
midgetpower
Which chars can be used for directives in an .ini file parsed by PHP? Hopefully I can use uppercase?
laszlof
midgetpower: why would you want to use uppercase
lower case is pretty standard.
midgetpower
Which chars can be used for directives in an .ini file parsed by PHP? Hopefully I can use uppercase?
Dustin|Work
midgetpower, what chars can be used in a normal directory?
There's your answer
laszlof
21:02 < laszlof> midgetpower: why would you want to use uppercase
21:02 < laszlof> lower case is pretty standard.
midgetpower
Dustin|Work: Depends?
Dustin|Work
How does it depend?
The only characters not allowed in a filename in *nix are NUL and /. In Windows, only NUL, :, and \ are truly not allowed, but many apps restrict that further, also preventing ?, *, +, and %.
laszlof
why dont you just try it?
Alphos
Dustin|Work directive != directory
         

sadtaco
How can I have a get that is like page.php?foo&formvalues=etc on a form? if I have the form have a hidden input with name="foo" it ends up as page.php?foo=&formvalues=etc
laszlof
just put it in the action.
action="page.php?foo"
inputs are always treated s key/value pairs.
sadtaco
Well I did that and it stripped it away... weird
Alphos
sadtaco you probably submitted the old form. refresh before submitting next time
laszlof
sadtaco: heh, so it does.
sadtaco
Nope. It was like that on the old form
laszlof
ive never really done that with GET forms before
sadtaco
action="page.php?foo" works for POST, but nto GET.
laszlof
solution, use POST :)
sadtaco
not*
Yeah I needed to use get here so it works for both a form and url
laszlof
you can code that in your backend
sadtaco
I changed it to name="act" value="foo" instead so it has a two part thing.
True enough.
laszlof
i.e. use $_REQUEST if you dont care if its GET or POST
sadtaco
using an "act" or "action" get is more efficient than checking for many different GETs being set, anyway
laszlof
or, set a value to foo
right
we do _action=whatever
typically.
sadtaco
ie page.php?act=foo
Aye. Problem solved.
laszlof
TIL: GET forms will overwrite any parameters you pass in the action
Alphos
hm, that's odd...
you'd expect an overwriting of conflicted keys, not a plain destruction
berezovsky
hi
Wulf
hi berezovsky
         

berezovsky
why this (strtotime('16.11.1957')) returns negotiate number?
Wulf
"negotiate"?
berezovsky
negative
Wulf
"strtotime  Parse about any English textual datetime description into a Unix timestamp"
is "16.11.1957" in English format?
berezovsky
"Dates in the m/d/y or d-m-y formats are disambiguated by looking at the separator between the various components: if the separator is a slash (/), then the American m/d/y is assumed; whereas if the separator is a dash (-) or a dot (.), then the European d-m-y format is assumed. "
its european
Wulf
okay, lookup what "unix time" is
Dustin|Work
Unix time (also known as POSIX time or erroneously as Epoch time) is a system for describing instants in time, defined as the number of seconds that have elapsed since 00:00:00 Coordinated Universal Time (UTC), Thursday, 1 January 1970
You're getting negative because the date is BEFORE the unix epoch date of 1970
berezovsky
yes, its dob
Wulf
whose?
berezovsky
i wanted convert DOB's into unixtime
for better storing/parsing
Dustin|Work
that's fine, a negative is still a unixtime
berezovsky
oh
Dustin|Work
It's just before the epoch, so it will be before the 'beginning of time' in a sense
berezovsky
so i can get this
back to the str?
thanks dustin, you're my personal god
Dustin|Work
http://www.onlineconversion.com/unix_time.htm
No problem sir, you can use that tool to quickly check the unix time to date
Working on an enterprise timekeeping codebase at my last job, I picked up more than my fair share of date/time knowledge :P
theskillwithin
I have a function that accept and ASIN and returns its SalesRank. I am trying to make another function gotSalesRank that has already gone through all the ASINS and paired that data with its sales rank so that gotSalesRank will accept an asin and return salesRank as well.
So I am doing something like return "$ASINN => $sales_rank", then to get my new functions data I have a loop and array_map("getAmazonSalesRank", $explode) but I know this is improper
http://pastie.org/10287135
berezovsky
tizery poshli
pora svalivat
sorabji
theskillwithin: still working on that?
theskillwithin
yea
I have a 3rd job interview on monday, so I really want to finish this project for my boss before I leave
So the person who takes over can have some neat tools, and then I can kind of push them in the right direction in their personal study
Vegitto
Hi. I converted the whole sentence to lowercase, but I want to convert the word 'I' back. I did: $modifiedvalue = preg_replace("^\i ", "I ", $modifiedvalue); $modifiedvalue = preg_replace(" \i ", " I ", $modifiedvalue); $modifiedvalue = preg_replace(" \i$", " I", $modifiedvalue); But that does not seem to work for some reason. Any ideas?
theskillwithin
if you feel like helping me I can add you to the private git repo =]
@str_replace
__adrian|away
Vegitto, idea: read your error messages.
theskillwithin
Vegitto http://php.net/str_replace maybe this?
sorabji
theskillwithin: o i just offer advice here, i try not to write other's code for them :)
Vegitto
Right, but I want to do it in the beginning of phrase too.
str_replace is not capable of that, is it?
theskillwithin
I would try to find a way to do it without regex
idk Vegitto im no good at this, just at googling
__adrian|away
Vegitto, when you did `preg_replace("^\i ", ... )`, what did the error message say?
Vegitto
__adrian|away: no error message registered in error_log
__adrian|away
check your error reporting settings.
!+error reporting
php-bot
Set 'error_reporting' to -1 and 'display_errors' to 1 in your php.ini and be sure to restart your webserver/fastcgi-listeners. This is more reliable than using ini_set() and error_reporting() in the script, which will fail if there are parse errors. See http://php.net/errorfunc.configuration for more.
__adrian|away
sorabji
theskillwithin: at a high level you want to store the fetched asin ratings, and verify that you don't already have it before making the curl call
__adrian|away
^--- that's the "some reason" you couldn't figure out.
theskillwithin
yea sorabji this way when I run the sort its not calling that getasin function 2000 times, only 300 times.
also later when I'm done it will make it easier to test the code
Vegitto
No ending delimiter '^'
sorabji
theskillwithin: so what part are you stuck on?
theskillwithin
this is where the idea came into play to create the gotasin function that already has a list of asins to ranks
__adrian
right. in fact, i think you don't have delimiters at all, and you expect ^ to be an anchor... which i'm not sure makes sense, but hey.
theskillwithin
So I had the idea to modify my getasin return to return "$ASINN => $sales_rank"; in order to push that into a new array of pairings when I run the loop in my gotasin function. but this is clearly incorrect
__adrian
so, is this a _single_ sentence?
« prev 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 next »