logs archiveIRC Archive / Freenode / #php / 2015 / September / 29 / 1
ProNoob13
unserialize('a:1:'.implode(';a:1:', explode('.', $string)))
aretecode
chiarot like this: `while(odbc_fetch_row($rst){var_dump($rst); /* your stuff with vars ... */ }
Alphos
ProNoob13 ugly hack is ugly XD
Chiarot
Parse error: syntax error, unexpected '{' :(
dean[h]
Alphos: what is $stuffafterthearrow
aretecode
forgot the closing `)`
Alphos
dean[h] "the stuff after the =>"
aretecode
`while(odbc_fetch_row($rst)) {var_dump($rst); /* your stuff with vars ... */ }`
dean[h]
so the actual YAML value in this case?
         

Alphos
yes
but it doesn't work the way i expect, hold on a sec
dean[h]
ill put up a coded
*codepad. damn mac autocorrect
http://codepad.viper-7.com/hWzY73 this is unfortunately as far as I got (without recursion)
Sammitch
dean[h]: why the aversion to recursion?
dean[h]
I'm not averse to it, if it's the right tool for the job
It may well be here
Sammitch
dean[h]: well then http://codepad.viper-7.com/pNdUL3
Alphos
dean[h] http://codepad.viper-7.com/ptCMkz
dean[h]
Sorry Alphas i think you misunderstood
I don't literally have that string as my input
check my codepen, that's my input
Chiarot
Parse error: syntax error, unexpected $end in C:\Shipping\Web\Doc\html\print-list.php on line 175 175 is </html>...
dean[h]
Sammitch: that's almost what I'm after, apart from assigning a known value to the last nested key
Alphos
dean[h] doesn't make a diff
dean[h] the point is you have the key and the value
everything after that is gravy
Sammitch
dean[h]: ooh fun an example that makes sense :D
Alphos
then, obviously, !+array_merge_recursive
php-bot
then, obviously, array array_merge_recursive(array arr1, array arr2 [, array ...]) - Recursively merges elements from passed arrays into one array - http://php.net/array_merge_recursive
jimi_
In DomDocument is there a way to do like in simple xml $foo->firstName instead of having to do it like this in dom doc? $entry->getElementsByTagName('firstName')->item(0)->nodeValue; There is only ever one firstName element attached to this node, so this is a long winded way
python476
hi there
Alphos
jimi_ domxpath for instance
jimi_ php.net/domxpath.evaluate
python476
composer complains about /usr/bin/java not being in open_basedir even though /usr/bin is . Is it obligatory to list an absolute filename instead of just a basedir ?
ExoUNX
greetings
Alphos
python476 symlink to somewhere else ?
python476
Alphos: yes
         

ExoUNX
I'm currently using simple_html_dom and exporting HTML content as $html, how do I parse this?
Alphos
python476 need i say more ?
python476
I've read about a 'bug report' from 2007 mentioning this
Alphos: to a newbie you'd be welcomed :)
Alphos
python476 the symlink is fine, but it possibly points to a file that's not in your open_basedir ;)
and that file isn't fine ;)
python476
oh .. I get it.. the error is `is_file ... ` .. and it's not a file but a symlink. case rested
Alphos
ExoUNX why not use php.net/dom ?
python476
Ah.. my epiphany is wrong then
dean[h]
Sammitch Alphos almost... http://codepad.viper-7.com/y8UA59
Alphos
python476 no, your epiphany was right
python476
Alphos: you're right, this link points to far away from the listed basedirs
Thanks a lot anyway :)
Alphos
python476 yw
python476
I'll settle on an half epiphany
Alphos
nah, we had the same
Sammitch
dean[h]: doneski http://codepad.viper-7.com/bEBRLg
ExoUNX
Alphos, I tried, has issues with couldn't get it to work :/
Alphos
we just worded it differently ;)
ExoUNX we don't support simple_html_dom, so maybe we could work your issues with dom ?
dean[h]
Nice Sammitch
Thanks so much for help both Alphos, Sammitch. Now let's see if this YAML dumper spits it out as i hope
Alphos
dean[h] yvw, love to recurse without recursion ^^
makes what's left of my brain work a little :/
dean[h]
Mine gave up a few hours ago
Sammitch
I just like interesting problems :P
Alphos
yours doesn't have a continuous migraine for a month :-/
dean[h]
I'm kinda pissed I have to do this. So strange that the SF2 component won't give me a message catalogue in an unflatten format
ExoUNX
ok so I need to log into a website, fetch the html and then parse it
the php documentation didn't seem clear on the post portion
Alphos
the post portion ?
Sammitch
ExoUNX: do you have explicit permission to scrape this site?
ExoUNX
Sammitch, yes
Alphos
dean[h] you could ask people in #symfony if there's a workaround
dean[h]
yeah i've done so, no response :)
Alphos
dang
dean[h]
They use recursion to flatten it ;-)
Alphos
bug/featreq then
dean[h] so what ?
nothing wrong with recursion
dean[h]
There is at 10:30pm
Alphos
(if done right, and i trust they do)
Bad_Advice_Cat
-___- I can't find spending money.
Alphos
Bad_Advice_Cat : kitty cuteness doesn't pay anymore ? :(
Bad_Advice_Cat
Nope. I only have emergency money.
ExoUNX
so what's the best way to go about this?
Bad_Advice_Cat
ExoUNX, well, you did not say what you mean by "post portion"..
ExoUNX
and Alphos, yes I need to post login information to the website
dean[h]
Ah great, now the YAML dumper, doesn't output in the pretty format
Time to call it a day i think =)
ProNoob13
$document->getElementsByTagName('input');
Alphos
ExoUNX so do that. you might want to use fopen wrappers, or curl, or easier yet, a library like guzzle which will handle all that for you
Sammitch
ExoUNX: at some point it's probably giving you a cookie with a session ID that's attached to your authentication. are you grabbing, storing, and reusing that cookie for authenticated requests?
ExoUNX
Alphos, curl seams possible
Sammitch, I can re-login each time, it's not that costly to do so
Sammitch
guzzle++
ExoUNX
here's the script now (w/o senstive info) that works - http://pastebin.com/f6iWAEVk
Alphos
ExoUNX if you have trouble grasping the documentation for dom, stick to guzzle
ExoUNX
ok I'll check out guzzle
wumbie
nginx channel is quiet.. I can't figure out why I need getting 404 not found nginx/1.4.6(ubuntu) when trying to visit my wordpress site. Here is my server config: http://pastebin.com/Hh03HbtF
Bad_Advice_Cat
(Action) summons __adrian.
wumbie, a quiet channel does not justify question. - You should be reading your logs and googling the symptoms up.
1 2 3 next »