logs archiveIRC Archive / Freenode / #php / 2015 / August / 7 / 1
DissidentRage
$arr = array('a','b','c'); foreach($arr as $letter) { $$letter['row'] = ...; }
Whiskey
thanks
DissidentRage
mhm
robert45
sorry, got disconnected
Hi DissidentRage, not sure if you got my response, thank you for replying btw. They are all inside a subdirectory in public_html/Boards
DissidentRage The full error is here: http://pastebin.com/h22vNa2f
I though it was a cache problem, but isnt
DissidentRage
are you just doing include('self.php');?
it would expect it to be in the same dir
AcousticDan
^^
robert45
this is weird, it was running ok with suPHP
thebuccaneersden
if it aint broke...
fix it until it is...
AcousticDan
I've never heard of suPHP, I just checked it out. Do you think maybe you have a permissions problem?
         

CapnKlutch
I don't even know where to start or how to look this up, I have an array with values in it. I need to sort the array in a specific order. But this array may not contain all the values in the order
AcousticDan
Seems like that's the whole deal with suPHP. Not sure though
CapnKlutch: like, uhh, what kind of order?
CapnKlutch
So I need to sort ['T', 'A', 'Q', 4, 9, 5] By this order A,K,Q,J,T,9,8,7,6,5,4,3,2,1 how do I approach this?
laszlof
..
Sammitch
usort()
CapnKlutch
usort will not give me the order I'm looking for
because J comes before T
Sammitch
it will if you write your own comparison function
http://php.net/manual/en/function.usort.php
CapnKlutch
Can you send me a snippet so I can see how
AcousticDan
Unfortunately CapnKlutch, it's not going to be as straightforward as you'd like
What's the reason you can't populate the array in the correct order? Just wondering..
Sammitch
$order=[...]; usort($foo, function($a,$b)use($order){ ... });
Whiskey
http://codepad.org/IhTrAf9P <-- gives me Illegal string offset 'c' in
http://codepad.org/IhTrAf9P <-- sorry that one
http://codepad.org/CWNDgILS <-- that one
ule
Whiskey: wtf is that
AcousticDan
yeah, lol
ule
$table["$ext|data"]
$$ext ?
fwrite?
Whiskey
naaa $table["a|data"]
ule
wtf
Whiskey: where is the fopen.. fwrite without $fh doesn't make sense
Whiskey
works good
only problem is $$ext
CapnKlutch
Guys I used this to do it before and I can't figure out why it wont work - http://pastebin.com/PDub2Qu5
AcousticDan
well, that $$ext makes no sense
ule
Whiskey: Are you drinking whiskey and coding php dude?
         

AcousticDan
runinsquares
ule he was told like 3 days ago to sort out his spaghetti
ule he just keeps going forward
ule
lol
troll master
Whiskey
$$a['row'][$table["$ext|data"]].$$b['row'][$table["$ext|data"]]. $$c['row'][$table["$ext|data"]] <-- thats what i try to do whit $$ext
[2015-08-06] [22:21:00] »» [DissidentRage] $arr = array('a','b','c'); foreach($arr as $letter) { $$letter['row'] = ...; } <-- was exactly like that
CapnKlutch
please someone? http://pastebin.com/PDub2Qu5
ule
Whiskey: try this: $💩 = 'hi'; echo $💩;
Whiskey
runinsquares, try to make the code a bit less insted of rewrite same thing 6 times
runinsquares
Whiskey, remove pipes, fix database schema
Whiskey
i have not wrote that part
AcousticDan
CapnKlutch: trying to get the order of cards?
CapnKlutch
AcousticDan, yes
Trying to order them
I used this in my app in another place and it works
Just not here
Alphos
Whiskey when you end up using variable variables, it's a sign you're doing something wrong. stop it right now.
AcousticDan
CapnKlutch: why don't you make each card a two dimensional array?
0 => ['suit' => 1, 'card' => 'J']
and have a suit array ['S', 'D', 'C', 'H']
so 0 would be, Jack of Diamonds
CapnKlutch
Great idea, however I would have to change out the too much code, this code I have should function but I don't see why it's failing. $order returns empty
Whiskey
its the only way to loop it and save like 100 lines code
i don´t see the point to repate it whit diffrent variables when i can loop around it and do same thing
Alphos
Whiskey the point is WHY would you need to do that
Whiskey every time i look at your code, it's more jumbled. you're making it harder on yourself for no good reason
Whiskey
Well i don´t agree
Alphos
i don't care about your code, i don't need it to work. my life will be the exact same whether your code works or not. but please, for the sake of kittens, stop making things worse
CapnKlutch
AcousticDan, can you help me fix that code?
Alphos
Whiskey why do you even consider coming here if you don't give a damn about the advice of people who are here ?
Whiskey
Alphos: http://codepad.org/vy0McWk8 <-- you like that more as it was before?
Alphos
Whiskey i hate it less
Whiskey
Alphos, well thats not tru, i just not got the skills to do it as the good ones, what more can i say? i do the best i can of it
Happy_the_Exceed
(Action) pokes DissidentRage.
YOU NEED IT!!!
AcousticDan
CapnKlutch: Sorry, I'm at work or I'd take a better look at it
Whiskey
its same code over and over again, for no reason, its not that was you make code do? Work for you insted of repete the stuff
DissidentRage
?
wat
Alphos
Whiskey if you don't even listen to us, you're not going to get any better. if you're unwilling to accept that we could help if you follow our advice, you have no business here
Whiskey
Alphos: still skills, i do listen i just don´t know how
CapnKlutch
Makes no sense why this doesn't work, please I need help - http://pastebin.com/PDub2Qu5
$order returns empty
Alphos
we're not here to look at your ramblings and crappy code. we're here to help you write better code by giving you advice. you don't want it ? don't take it, that's fine. but don't come here asking for it
Whiskey
Something i have tp accept, if i could code correct everything would be nice and clean in OO
Happy_the_Exceed
DissidentRage, you. need. it. :+)
DissidentRage, vagrant :D
Alphos
Whiskey the ugly part of your code is not related to object-oriented programming. it's related to what you do with it
Happy_the_Exceed
DissidentRage, as far as "Resource usage" goes, here is what mines look like: http://uploadpie.com/PY7oL - A whopping 37.3 MiB used. :)
Whiskey
If you don´t have the skills what can you do
DissidentRage
oh jesus
Whiskey
I have try over and over again understand how the OO works, i don´t get it in my head stiull
DissidentRage
that subject is old
Whiskey
still
Alphos
-> instead of [] wouldn't make a difference. your code is just ugly, and for DAYS now you've done nothing but make it worse, despite our best effort in that matter
« prev 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 next »