« first day (641 days earlier)      last day (4307 days later) » 

3:00 PM
@Bracketworks correct
 
I don't always throw Exceptions, but when I do
 
"Exception: Dos Equis not found"
 
I don't always throw Exceptions, but when I do I Fatal error: Uncaught exception 'MostInterestingException' in
 
Ow ow ow... this query is hurting my eyes:
0
Q: Whats wrong with this php code that exports mysql records to csv?

eddy otehI have this bit of code on my file and its working well for a different file but on this new file which does the same thing with the one that works, it doesn't work mysql_select_db($db); $result = mysql_query("SELECT CONCAT(employees.first_name, ' ' , employees.middle_name, ' ' , employees.last...

 
Neal, you've broken the train...
 
3:08 PM
@Neal Don't worry - he's only working with banks and payrolls :\
 
@webarto ha. sorry. that was not on
 
posted on July 18, 2012 by Lorna Mitchell

Today I'm giving my first ever talk at OSCON - about PHP 5.4 (I'll also be giving my second ever talk at OSCON, about RESTful services; it's a busy day!). My talk includes some benchmarks which I thought I'd also share here, mostly because I like pretty graphs - and this one is pretty: This graph shows the performance of four versions of PHP (because the bench.php script that lives in th

 
@Neal bit a bullet when
 
@webarto on bit? that makes no sense :-P
PLEASE TELL ME YOU DON'T REALLY WORK FOR A BANK!Neal 6 secs ago
 
haha if he does, tell me what bank is it :D
 
3:11 PM
@webarto Avoiding insert bank here
 
0
A: Whats wrong with this php code that exports mysql records to csv?

Neal1st thing is 1st: Make sure the query does not have an error. 2nd thing: Use prepared queries, the one you have now can lead to a bobby-table...

 
@Neal Don't most financial institutions use .NET?
Maybe it's a sperm bank...
 
7
Q: Why does "print" prints from right to left?

qxxxCan anyone please explain me how this works: <?php print 5 . print 6 . print 7; ?> it prints: 76151 I know the "1" is the return value from the print function but why are the functions called in reverse order?

called it, reputation mine
 
@MikeB eh?
 
Questions like that generate huge reputation swings
near-zero surface application.. yet interesting to a lot of people
Once you see the answer you realize that's something you've understood all along.. just never in those terms
 
3:18 PM
Ahhh haaa
@MikeB I did not even know that php allowed this legally
 
@Neal i was talking with someone yesterday about how many big corps out there have complete crap code as far as standards goes.. Bobby Tables type scenarios, etc.
 
@Neal Because why would you ever concatenate print statements like that...
 
it's madness
 
@webarto madness? THIS IS PHP!
 
seems legit :D
 
3:24 PM
@Event_Horizon I AM SPARTACUS!
 
TONIGHT WE DINE IN HELL CODE IN PHP
 
they may take our lives but they’ll never take our PHP!
 
oh my lord
 
^_^
 
Program1: You have my properties!
Program2: and my methods!
Program3: and my comments!
 
3:34 PM
MySpacebarJustBroke
 
Wow wtf.. my android phone is syncing my text messages with my work's exchange server
I get an email for every text message to my phone...
 
Now I have to use an nbsp copied from charmap
 
my keyboard broke after I cleaned it... FU Dell
hah, @Bracketworks been there
 
There we go
It's lopsided now
 
anyone know where teh trash is located on os x? like the actual path to it?
trying to delete 16,670 files and osx is having a conniption fit.
 
3:40 PM
whereis trash :P
 
What do you call a homicidal bee? A buzz-kill! rofl rofl rofl
 
found it, ~/.Trash/
@webarto that wouldn't work as Trash isnt an application, but a smart window in finder.
hah, take that osx.. sudo rm -rf ~/.Trash/*
 
Hey guys
 
SUP TRUTH
 
3:43 PM
@gorelative better hope the finder doesn't do some fancy indexing stuff that relies on those files being there... :)
 
i wouldnt care if it did. Stupid Finder.
 
@cHao Its just trash, whats the worst that could hap
 
hello? @Event_Horizon are you there? Hello?
 
Hahahaha just kidding, I don't use Mac.
 
@gorelative Probably Time Machine related shenanigans. If you're on a laptop, it religiously backs up everything first, especially when you're deleting it...
 
3:45 PM
@deceze i dont use timemachine, im a rebel. i use rsync, lol j/k.. my entire /users/username/* is synced to a g drive hardlink
 
Which means taking out the trash can sometimes take a while... :-/
@gorel :-O
 
@deceze I need to make an account thats just gorel so when everyone pings me it still pings @gorelative
 
no you don't
 
@gorelative lol
 
I don't listen to "dubstep", but when I do... youtube.com/watch?v=ZjJ2L0QOuls
 
user895378
@tereško Unfortunately a "crowd-sourced debugging service" is by far the most accurate description of what I see on the Stack Overflow main site these days. Also, thanks for link to the Krasner/Pope MVC paper. I want to re-read it again, but my initial thoughts as it relates to "Page Controllers" in PHP is that it doesn't specifically disallow a Page Controller from fully encompassing the view class from factory creation to rendering.
 
ajax inside for loop, I don't wanna live here anymore
 
user895378
(general MVC discussion follows) Specifically, this line from the bottom of page 7 might be used as a justification for that practice:
 
user895378
> Every instance of a view has exactly one model and exactly one controller. The model is normally set explicitly. Because view and controller classes are often designed in consort, a view's controller is often simply initialized to an instance of the corresponding controller class.
 
user895378
(emphasis mine)
 
user895378
3:50 PM
That said, what we refer to as a Page Controller is likely suboptimal because it is tying the View very closely to the controller (even when using a factory and dependency injection). The much better solution would be to treat the View like a free-standing entity in its own right. This diagram isn't an accident and it reinforces your statements and dislike for Page Controllers:
 
user895378
 
user895378
It's obvious throughout the paper that a more robust solution necessarily functions in an evented system where the different controllers/views/models can broadcast information about themselves to the other components. The failure in 99.9% of PHP apps currently in the wild is that they have no way for these components to communicate outside of direct connection to one another; they have no messaging system.
 
@webarto holy why would you do such a thing
 
user895378
Fixing the Page Controller is trivial if you have an event messaging system because you aren't forced to connect the View directly to the Page Controller. Instead, the different parts of the application can broadcast events and the interested parties can react of their own accord.
 
i hate how, no matter what you do when you re-login on os x lion it reopens the crap you closed. Its like it assumes no matter what that i want to do the same stuff... Maybe i wanted to play minecraft instead of web dev?
 
3:52 PM
@Truth Hi hi ^_^
 
> i hate how, no matter what you do when you re-login on os x lion it reopens the crap you closed.
:P
 
@gorelative nah man, this > stackoverflow.com/q/11545023/424004
 
@Feeds Has the bench.php script changed at all between those versions?
That's what I want to know.
 
oh thats not so .. OH MY LOVE OF JESUS.. MY EYES
 
@rdlowrey you sound like a rocket scientist, for a tanned guy :)
 
3:56 PM
@Event_Horizon which is why i have ubuntu as a vmware :)
 
user895378
@tereško So all that said, I agree with your disdain for the all-encompassing page controllers in PHP. But I don't think they're a blatant violation of the original MVC principles. I just believe they're suboptimal and can be fixed by implementing an evented system.
 
@gorelative :)
 
@gorelative Never had this problem.
 
user895378
@webarto Other people use the sunlight to generate Vitamin D. My body photosynthesizes brain cells.
 
hey fellas
 
3:58 PM
@AndyPerlitch hiya
 
anyone with some mvc knowlege care to shed some light on stackoverflow.com/questions/11545207/…
thanks
 
@Mark Looks like you are doing multiple queries for get data which you could have retrieved in 1 query
 
@rdlowrey , this is why i have been asking this week about implementation of view
 
Oeh. we are talking about controller and views here?
 
0
A: format an input field and print a round number

Jim NortonYou might consider rounding your input $omtrek using the floor() function before using it in your if-else statement. And here is your code modified showing that the output is indeed 100. <?php $omtrek = 98.7; $omtrek = floor($omtrek); if($omtrek >=53 && $omtrek <=5...

Is my answer correct?
It appears to be based on the output.
 
user895378
4:03 PM
@tereško Yes. I think you were right to do so. The view should be extraordinarily simple (and the paper backs that up), but that doesn't mean it should be completely anemic and have it's entire operation managed by the page controller.
 
And greetings!
 
user895378
I'm going to take steps in my own code to remedy that situation.
 
@Peeh yes, I could probably have achieved it with some left joins I guess... but regardless the problem still exists... I have x objects and I still need to create y objects
 
@JimNorton hiya
 
if that makes any sence?
 
4:05 PM
@PeeHaa Hey... how goes it?
 
@PeeHaa , we are talking about something named "Page Controller" in relation to the original pattern and implication of it in web related interpretation of whole mvc thing
 
@JimNorton Pretty good. You?
@JimNorton Please drop the elses and use a switch statement
 
@PeeHaa Good good... trying to learn some PHP by answering questions.
 
@PeeHaa this
 
@PeeHaa Of course, but that is what the OP wrote.
 
4:08 PM
@JimNorton I don't know in , but in [PHP] OP always is stupid :)
 
but, but... there is a pattern there...
 
user895378
@tereško I think the reason the page controller situation developed in PHP is because each request is "one and done." Because the PHP process dies after each request is serviced most PHP devs never have any need to implement event messaging systems in their code. Everything can simply happen in one straight line and then script execution terminates.
 
@tereško Have been thinking about that stuff for my blogging system for too long yesterday on what route to take -> still have no idea how to implement it to my liking
 
yeah , i know exactly what you mean
 
@PeeHaa Same goes for C++, generally, just ask the folks in the C++ Lounge. :-)
 
Why would it be closed?
 
How should the page behave in production if it can't connect to the DB?
 
it should show a lolcat, in all seriousness show something like "experiencing system error" and dump a log, maybe notify a dev?
 
@gorelative 404?
 
user895378
@PeeHaa and @tereško I actually think I have a really good implementation worked out for how to implement an MVC PHP application without the Page Controller. I just need to write it and then I'll share. We'll see what happens.
 
4:12 PM
404, is if something can't be found.. you could use it but i would opt to show something more descriptive.
 
@JimNorton We are all doomed! ;)
@rdlowrey I would be really interested
 
@JimNorton it's not a real question. there's nothing there that asks a usable and meaningful quesiton IMHO at least
 
@rdlowrey wouldn't that make an MVC-like pattern more applicable than traditional MVC?
 
user895378
@gorelative Woah! Did @MikeB send some thugs to your house to make you change your nick?
 
you could use 404 but my recommendation is to make sure it is a non-specific page.. granted its a 404 page.. but what i mean is dont say "page not found", because that obviously is not the case.
@rdlowrey did you just now realize who i am? I did it to be nice. Not all members of chat are .. well yeah.
 
4:13 PM
@PeeHaa , my current possible solution is that controller accepts both request and response instances , then in controller the messages for view are stored .. then after controller's action has been completed , it initializes a view which required the response object in constructor
 
@ircmaxell But you answered it anyways? Nice answer though.
 
@gorelative okay, my page initialises conection, it failed, I echo a fancy error, but how do I stop other functions to be executed?
 
user895378
@orourkek Well I think it qualifies the "page controller" variation as "not incorrect." But I still think the page controller is inferior to what can be achieved if following the original MVC concept.
 
@gorelative exit will cause half rendered page...
 
@tereško Shouldn't it be the other way around? The response object takes the view in constr? Aaaaaarrrrggh I have been thinking too long about this. So many options so many suck :(
 
4:15 PM
@JimNorton , that is the worst thing i have seen today
 
@rdlowrey true enough past a certain scale
 
user895378
@PeeHaa When you get confused, just look at the picture again. I find it helps:
 
user895378
24 mins ago, by rdlowrey
user image
 
@tereško Yeah, I thought you guys might like it.
 
user895378
It's always best to go to the source. And if the original source material has illustrations it's even better :)
 
4:16 PM
@ircmaxell had a good answer for it though.
 
@hookman i thought we already answered this question of yours..
2 hours ago, by deceze
@hookman ... or die(functionThatOutputsACompleteErrorPage());
You could also redirect them to an error.php file. that has a different layout and doesn't require a db connection.
e.g; write the error to a log file, redirect them to an error.php file, show non specific "pretty error page".
 
@tereško It's not MY shit... it's the OP... I just simply answered the OP's question about how to fix what he has without a complete rewrite.
 
wait no .. actually it's wrong , no , it must be right : $omtrek = $omtrek - 2 + ($omtrek + 2) % 5;
 
@ircmaxell I simplified your code a bit:

<?php

$omtrek = 98.7;
$omtrek = 5 * round($omtrek / 5);

if ($omtrek < 53){
    print 'Helaas';
} elseif ($omtrek > 142){
    print 'XXL';
} else {
    print "maat: " . $omtrek. "<br/>";
}

?>
No need for the rounding etc in the final print.
 
4:25 PM
@JimNorton I guarantee you that that wont fly. This argument has been brought up before, whether to correct the OPs code, or simply re-write it using his same methodology. Case in point, your scenario with if/else and switch.
 
@gorelative So I should re-write his code entirely instead of just make it work using the existing code with minimal changes?
 
@JimNorton if i remember the conversation in chat, the argument concluded that you should re-write the code if the OPs code breaks standards and does not comply to best practices. e.g; if/elseif/else vs switch
 
@JimNorton you changed the functionality of it. What if $omtrek = 142.25... what would happen then?
 
however, i am by no means an SO voice to listen to.. i am just telling you what has been discussed here in the past.
 
@gorelative You finally gave in and changed your name?
 
4:31 PM
@PeeHaa yes, i did. To be nice to @MikeB, in hope's hed buy me a beer one day.
 
@ircmaxell 140 would be printed
@ircmaxell And with your version the same thing would be printed.
 
@JimNorton No, in my version XXL will be printed...
 
@ircmaxell I actually tested your version... it printed 140
 
if ($omtrek < 53){
    print 'Helaas';
} elseif ($omtrek > 142){
    print 'XXL';
} else {
    print "maat: " . (5 * round($omtrek / 5)) . "<br/>"
}
 
4:35 PM
Hold on will show what I saw...
 
yea, I saw that
 
@ircmaxell Ok I stand corrected... perhaps I didn't save the file after editing.. sorry..
 
hehe
 
4:37 PM
Like I said, you answer is the best of the bunch..
 
@NikiC , but he's right
 
I don't look like a cop...
 
maybe because you have plenty of deep blue in your avatar
 
@ircmaxell thats because you are a cop
again you look like lt Batista from dexter in ur SO picture
 
4:40 PM
Muah, an undercover cop disguising himself as a programmer :D
 
lol...
 
"whats that, gorelative is using a pirated version of cs6", "whats that, @NikiC is using a pirated version of PHPStorm?" JAIL FOR THE BOTH OF YOU
 
@ircmaxell , the picture is like one that you would see on the "police officer of the month" board at the station
=P
 
@gorelative net.tutsplus.com/author/nikko-bautista bautista looks like batista
 
4:42 PM
@gorelative Hey, it's not pirated!
I didn't pay for it, but it's not pirated :P
 
I'm undercover to infiltrate the PHP community and destroy it from the inside out. I was hired by Jeff Atwood
9
 
@ircmaxell oh +1
 
user895378
@ircmaxell lol
 
i see
 
CS6 is out already?!? And here i just got the 5.5 lol
 
4:42 PM
@NikiC OSS license for the win.
 
@ircmaxell That explains a lot...
 
:-P
@NikiC hey, what's that supposed to mean?
 
@ircmaxell Thanks for your answer to that question... It was enlightening for me..
 
@NikiC can you please change your name, it confuses the hell out of me everytime i see it.
 
This will be deleted soon, read it while you can: php.net/manual/en/language.oop5.php#108744
 
4:45 PM
like that meme picture of Fry from Futurama
 
There are three people in this room that I will be angry with if they change their profile picture: @ircmaxell @NikiC and @tereško
 
I have changed mine in the past
 
Well don't bloody change it again :)
 
@LeviMorrison , i will change my name AND the picture
it's raining but i want a beer ... decisions , decisions
 
it's hot as hell, but I want a beer. And I'm at work. decisions, decisions...
 
4:50 PM
@ircmaxell :P
@gorelative Huh, why?
 
@NikiC because to me Niki is a females name =), not to be rude.
 
@LeviMorrison Do I also have comment deleting powers now?
 
@PeeHaa If you have doc karma, yes.
 
@ircmaxell Beer at work? Nothing wrong with that...
@LeviMorrison noice
 
@gorelative pff
 
4:52 PM
@gorelative You are an American or Canadian, aren't you?
 
@NikiC You get that a lot lately don't you ;)
But serious @NikiC if you change your name I will hunt you down ;-)
 
@PeeHaa I do :D
 
multi ultra super remove
 
@PeeHaa Hm, I wasn't fast enough to read it :/
What did you write? :P
 
I should rewrite php.net using Google Dart.
 
4:56 PM
@NikiC Replied on wrong message :P
@LeviMorrison no
 
@LeviMorrison You should rewrite php using dart :P
 
Dart is the first web development language I have liked since learning PHP.
 
How to optimize or increase the speed of a mysql select query?
 
@srini Depends on the query.
 
@PeeHaa for varying definitions of wrong
 
4:59 PM
@srini By removing it :P That's a fail safe way to optimize
 
@ircmaxell Ah right not cool to drink beer at the office @ 12:00 :_)
 
how is this possibru
 
@PeeHaa 13:00 here, but still...
 
@NikiC i can't understand
@NikiC how to increase the speed
 
@ircmaxell lunch time yay
 
5:02 PM
@gorelative Pick your poison :)
 
@LeviMorrison thanks
 
@ircmaxell Not ten minutes ago I was thinking to myself that an ice cold beer would be really good right now.
 
mmmm beer, makes me sleepy though.
 
@LeviMorrison any other way
 
@LeviMorrison is it similar to node.js in any way
 
5:03 PM
In PHP and JavaScript, "==" is pronounced "probably equals."
3
epic :D
Old, but epic :D
 
equal-ish
 
I like to call that equalitis
 
i always use ==
damnit, was trying to think of a neato meme to use, but i failed.
 
Should I even bother to hash with sha512?
 
5:06 PM
@gorelative "I don't always use ==, but when I do..."
 
should we bother with you? @hanleyhansen
 
@gorelative I always use a custom function for explicity: doesKindaMatch($val1, $val2) ;)
 
@NikiC any idea
 
169
Q: How do you use bcrypt for hashing passwords in PHP?

Vilx-Every now and then I hear the advice "Use bcrypt for storing passwords in PHP, bcrypt rulllez!!!11" OK, but what is this bcrypt? PHP doesn't offer any such functions, wikipedia babbles about a file-encryption utility and Googling just reveals a few implementations of blowfish in different langua...

 
== is quite useful...
 
5:07 PM
@webarto leave me the hell alone. if you don't wanna answer to my questions just mute me. you'll never see me again.
 
from now on i am going to refer to @NikiC as @Phillip
 
@gorelative wut?
 
@hanleyhansen whoa buddy, language like that is uncalled for. You should be using php.
 
@gorelative he's been bothering me for days now being condescending.
 
never gonna give you up
 
5:08 PM
@PeeHaa that was in reference to my prev comment about @NikiC's name.
@hanleyhansen then maybe you should ignore him? As it sounds like you have a problem with him, and not vice versa?
 
@gorelative unfortunately he knows what he's talking about so i don't wanna deprive myself from gaining any useful knowledge. i have no problem with him per say. he's the one that feels like he has to treat me bad every time i say something.
 
@MikeB hai mike How to increase the speed of a mysql select query?
 
run it on a faster machine.
 
@cHao
 
5:11 PM
since you didn't bother with any kind of useful info, that's about the only advice that'll always work.
 
2 days ago, by hanleyhansen
hey guys. what's the cleanest way to build an application with client-specific subdomain? should I make a subdomain for each client and a db for each client?
fun starts there
 
@webarto what's your point?
 
Anybody in here owns a raspberry pi?
 
raspberrypi.org I will try to shoot it down /amazing btw/
 
@hanleyhansen Well that statement is kind of retarded isn't it?" Either way, if he ignores you or you ignore him.. You wont be able to get answers about your questions from him so, outside of him providing random knowledge.. i see no real reason to not ignore him if you have such a problem.. that or take it up with a mod. Or you can do like most others do with scenarios like this, grow a thicker hide and learn to ignore it.
 
5:17 PM
@gorelative which statement?
 
6 mins ago, by hanleyhansen
@gorelative unfortunately he knows what he's talking about so i don't wanna deprive myself from gaining any useful knowledge. i have no problem with him per say. he's the one that feels like he has to treat me bad every time i say something.
 
@gorelative ok i will
 
> Interfaces can be used to simulate multiple-inheritance in php
 
@hanleyhansen hes not treating you bad, he is simply mocking your poor choice at programming decisions :). Treating you bad would be him smacking you around and calling you mean names.
 
5:19 PM
lol
Every time your floating point arithmetic system surprises a programmer, god divides a kitten by negative zero.
3
 
i am so glad i am not a moderator of SO or SO Chat, i would probably end up flying to some ones house and slitting their throat with a prison shank made from a spork.
 
@ircmaxell You have a link to go with that statement?
 
0
Q: How do you process invalid HTML in PHP?

TruthI've seen this question, which is very nice and informative. However, it doesn't deal with a rather common scenario. Say I need to scrap a multitude of websites (or even pages in the same domain), but the author of that website didn't care enough for his code, and has some seriously malformed co...

Couldn't find anything while searching
 
@gorelative You got my vote for the next election :)
 
@PeeHaa no, from an interview
 
5:20 PM
lol
i would have asked to elaborate
 
I did. his elaboration was pretty on point...
 
@ircmaxell where are you working now?
 
hey @tereško what is that sandbox chat place?
 
at my job
 
@ircmaxell lol
 
5:21 PM
well , i is quite hard to explain difference between abstract classes and interfaces with a one-liner soundbait
 
@tereško yeah, his overall answer was pretty good, just that one line out of context was fubar
 
and this , @gorelative , is why we ask follow-up question, when someone says something stupid ... they might be just bad at expressing themselves .. or it turns into something entertaining
 
@tereško indeed, entertaining it is.. just dont understand why people come in here without a thick hide.. If you're doing something illogical be prepared to be corrected, abruptly. It happens to me constantly.
 
@gorelative First thing I learned on the job 5 years ago when a senior told me I was am an moron
5 years later figured out he too is an idiot
 
lets say you have a collection of words, eg:

"foo","bar","baz"

And you have a subject string like this:

"Lorem ipsum dolor bar foo, foo amet, consectetur adipisicing foo, sed do eiusmod baz bar incididunt ut labore et foo bar baz magna aliqua."

How would you write a regex pattern to match any combination of at least one of those words (spaces and commas also would be captured)? So the resulting matches would be here (in parentheses):

"Lorem ipsum dolor (bar foo, foo) amet, consectetur adipisicing (foo), sed do eiusmod (baz bar) incididunt ut labore et (foo bar baz) magna aliqua."
 
5:37 PM
regex probably isn't the right tool - your rules don't seem regular-enough
 
@AndyPerlitch Very quickly done
((foo|bar|baz)[,.\s]*)+
 
clears throat
 
@MikeB :)
 
hahaha wow dude, thanks
 
@Truth Doesn't that also take the trainling space?
 
5:38 PM
@PeeHaa It does
In which case trim() is your best friend.
@PeeHaa It will also capture any trailing commas and periods.
 
@Truth trim() wouldn't be a very good friend always trimming what you want to say when talking to him
:-)
 
trying to optimize my nerdliness, should i watch the new lord of the rings trillogy while coding or have the animated series going
 
@ert3 I hate LOTR so I would go for option two whatever that may be
 
neither, you should be drinking coffee from your tardis coffee mug, while watching Doctor Who, while simultaneously watching How its Made
 
@ert3 New lord of the rings trilogy?
 
5:42 PM
i just did a doctor who marathon for the past few weeks, maybe ill go with my babylon 5 VHS's
@Truth the live action take
 
VHS? whats VHS?
 
@ert3 Try Naruto or FMA :)
 
would rather kill myself
 
@ert3 A proper response to anyone suggesting Naruto
 
Well, Naruto did get slightly out of hand every since they revived a certain someone
However, FMA is very good, very recommended for those of you who like sci-fi
 
5:46 PM
@Truth oh you mean when they revived the whole fucking cast, after years of buildup to a huge cataclysm that is just undone because fuck the viewer
I won't directly slight FMA, but after brother hood I think I have had my fill
 
@ert3 Nah, I mean Madara, the rest can go *** themselves.
@ert3 I meant brotherhood (that's the original btw, which sticks to the manga)
 
@Truth they should have just ended it after the Exams, had saske and naruto rent a room, and the series ends with Saske bricking in naruto's mouth.
THE END
 
Say I have a date: $today = new \DateTime("now"); -- what's the most logical way to check which pay period (1st thru 15th and 16th thru the end of the month)...
 
@Justin Nope, didn't understand.
 
so you want to check by day of the month what pay period a person is in?
so what you need is (payperiod first week friday) payperiod second week friday ?
 
5:50 PM
@Justin Say what?
 
lol okay...
 
date('D') would return the day of the week, you can say once two fridays have passed that is a single pay period and have it reset each month
 
@Justin btw what is "now"?
Ah right default nvm
 
now is now... lol
 
I always omit it
 
5:53 PM
same
DateTime();
 
@Justin id write you code but i think what you should do is make an array of days that looks for two of the same payday, IE one pay period for people who are payed every other week, use the date of that day to determine the current pay period ranging from last to next
 
With a simplexml object, how do I get the contents of a tag like <body.content> ? $xml->body.content obviously doesn't work
 
lack of sleep... Just figured it out.... with ert3's date thing...so date("d"); then check if the day is less than 15 or gt 15... to get the right pay period that we're currently on...
 
@stevether I hear great things about phpquery ;)
 
If you release something as open-source (e.g. under the GNU General Public License), but it also includes other open-source projects with different licenses, do you need to include those licenses in the license.txt file, or do you just have the license information at the top of the files from that project?
 
5:55 PM
@stevether , did you try reading the manual ?
 
user895378
@stevether have you tried $xml->{'body.content'}?
 
@tereško Helpful as always
 
user895378
well, that is kind of a RTFM question.
 
@JosephDuffy Yay let's start another war about GPL.
 
@Justin kinda date('D') = returns wednessday, date('d') returns 18, you keep track of the date('D') to count the iteration of a week and date('d') to determine the payperiod date start with a bit of math
 
5:56 PM
@PeeHaa I don't want to start a war :(
 
@ert3 He's using the DateTime class why would he use date()
 
@PeeHaa sleep deprivation
 
@rdlowrey Thanks
 
also datetime isn't needed for this
 
@ert3 datetime is always needed
That's how I roll
 
5:58 PM
not if you don't mind ignoring notices
 
@JosephDuffy hehe no worries. But I'm not a lawyer so sorry :)
@ert3 ?
 
What notices>?
 
oh if you use date without setting the time zone in your php.ini then you have to set it with datetime or you will keep seing a notice
 

« first day (641 days earlier)      last day (4307 days later) »