logs archiveIRC Archive / Freenode / #php / 2015 / November / 19 / 1
cryptomonk
greetings
anyone mind lending an ear to a DateTime problem? http://pastebin.com/fNmYnK3u error is on the $d->format gives me a Call to a member function format() on a non-object error
eh disregard fixed it...
vinex08
ohh i see, so i think i have to find a laravel dev then :) i thought its something i can do myself
DubstepCraig
How do you do that fancy HTML echoing thing in PHP again? https://gyazo.com/955af72c2103004d44f81d0b888f8403
(Anyone)
ss23
um
You add quotes
DubstepCraig
No the other cool way
ss23
echo '<meta...';
um
You don't include PHP tags?
Or
heredoc/nowdoc?
http://php.net/manual/en/language.types.string.php#language.types.string.syntax.nowdoc this thing?
DubstepCraig
It's like EO something...
ss23
short tags?
<?=$variable?>
DubstepCraig
Yes my dawg
That be it, thanks ss23.
         

Bad_Advice_Cat
DubstepCraig, you don't O_O
DubstepCraig
? :O
Bad_Advice_Cat
DubstepCraig, there are reasons to NOT echo html, http://thisinterestsme.com/php-best-practises/ <-- This web page explains why not. Scroll down to "5. Dont echo out HTML!" - There is also link with examples.
DubstepCraig
Thanks, I'll just end the PHP tag then.
Bad_Advice_Cat
DubstepCraig, and for further reading on the subject. https://gist.github.com/adrian-enspired/9ed2542a695e2ebe30aa
DubstepCraig
Bad_Advice_Cat: Btw I've learned so much OOP since we last spoke.
Bad_Advice_Cat
:D Sweet.
DubstepCraig
I don't think I could ever go back to proc
dojobo
if i want to use elements in an array as the pattern for a preg_match... i guess i should do $pattern = implode("|", $array) first?
or is there a function that will use the array?
Assault
hi all
sgfgdf
hello, guys! how can i workaround the session locking problem when one heavy request blocks all my other requests to run in parallel?
rkt
sgfgdf: sbread them to differentbackends or create some worker logic
spread
worker logic like a queue
YamakasY
anyone an idea why some headers are not visible in my mail source @ the receiver ?
one is added, some simple one the rest like list-unsubscribe is ignored
or at least not visible
rkt
how u set the header how you deliver some headers are server specific so it depends on the server u send it to or from
mail is pain
YamakasY
rkt: yap I know
I think I can ignore it as the receiver doesn't see it as newsletter
I already did so much :) it's nice now
rkt
personaly i never use any additional header unsuscribe jsut attach a link with token in the footer
YamakasY
rkt: yap did that too!
rkt: but there is looked @ headers by the receiver
Hackwar
hi folks
I need to retrieve some files with unknown filename from an SFTP server with PHP. I've stumbled over several different explanations on how to connect via sftp, but they are all from the last decade. Are those still relevant?
oq
Hackwar: using the ssh2 extension?
Hackwar
yes
         

kelyane
I am trying to get IP of my computer, like 192.168.1.53, not the IP server 127.0.0.0. I tried $_SERVER['SERVER_ADDR']; but show me the IP server. Someone knows how I can get it?
nicholasruunu
GHugo
ussher_
kelyane: if your computer is linux, type ifconfig from the command line, I think for windows its 'ipconfig' from memory.
kelyane
ussher yeah! I know it. but I would like it in PHP code.
nicholasruunu
kelyane, $_SERVER['REMOTE_ADDR']
oq
kelyane: what does var_dump(gethostbyname(gethostname())); get you?
kelyane
nicholasruunu, $_SERVER['REMOTE_ADDR'] and $_SERVER['SERVER_ADDR'] are the same result. 127.0.0.1
oq string(9) "127.0.1.1"
nicholasruunu
kelyane, Are you using varnish or something in between the webserver? Or are you sitting on the server trying?
Try this approach: http://stackoverflow.com/a/13646735/1922428
kelyane
nicholasruuu I am sure, I don't know it.
nicholasruuu this your last suggestion link, returns the same =/
nicholasruunu
kelyane, This is how Symfony does it: https://github.com/symfony/symfony/blob/945630a8fac2e18af58059f877aa555e94cbfc19/src/Symfony/Component/HttpFoundation/Request.php#L805
dojobo
oh ffs, i could throttle my predecessor right now
last commit on the repo was july (what i cloned to my pc), i've been doing some work on it
and i discover there are changes on the server in august
stupid me for having to learn the hard way i guess
nicholasruunu
dojobo, copy all files over to the repo, go through diff and commit as one commit I suppose. :P
dojobo
yeah :-/
Omar-
hello
dojobo
hello Omar-
Omar-
hi dojobo :)
i'm preparing my question
when I echo my database in JSON format (code: http://pastebin.com/cCUBqEmM) rows are duplicated and looks like this http://pastebin.com/Zf7JkPpt
I dont want { 0: "value"} , { 1: "foo"} ... etc.
I need only { "urb": "value"} , { "price": "foo"} ... etc.
ak5
ls
oops
dojobo
Omar-: i think you want either mysqli_fetch_row() or mysqli_fetch_assoc()
ak5
guys, I am having one of those moments, most like. Error on line 24 unexpected '(', expecting ',' or ';'. Line is: private $uniqid = uniqid(); What could be the problem??
dojobo
try assoc
Omar-
dojobo: I will read about it. Thanks :)
dojobo
fetch_row is just a regular array ["value", "foo"] and assoc is an associative array ["urb" => "value", "price" => "foo"]
and fetch_array is a combination
or--you can keep it as fetch_array, but use the optional argument to specify MYSQLI_ASSOC
salathe
ak5: you can't call that function there, the property value needs to be a constant value available at compile time... you should assign a value to the property in the constructor... $this->uniqid = uniqid();
ak5
salathe: thanks
philm88
I've got a webapp that I need to add some caching to. The caches should be built asyncronously in the background and the runtime app should just pick up whatever cache is available. I'd also like to build it so multiple caches can be built at the same time. I'm not sure what would be better; multiple crons to acheive parallel builds, or, a single daemon php master process that manages multiple child cache-building processes. ...
... What do you think?
koshie
Hello everyone. I'm starting PHP and reading php.net. Do you know a good website with exercices for all levels? Thanks.
english nor french
fffuuuL
or french or nor french? :P
Omar-
lol
koshie
Sorry my english isn't perfect.
nor is "or / and" right?
fffuuuL
koshie: What exercises do you need? Did you read the documentation? Language reference??
Omar-
koshie nor = no/not/neither
koshie
fffuuuL: I started to read the documentation of php.net, some references too. But read for reading is annoying and it doesn't giving you small exercice to practice.
Omar-: oh ok.
1 2 3 4 5 6 7 8 9 10 11 12 next »