logs archiveIRC Archive / Freenode / #php / 2015 / September / 2 / 1
Bittarman
Naktibalda, I'm saying that if you're using lots of different timezones, setting the internal timezone is less favourable than the class which lets you manage multiple things all with their own timezone and work with them correctly
so.. kinda, yes.
iSRAELi
Hi guys,
was wondering why this: http://pastebin.com/UEtGxQiz
returns the $s1 value
and not the "i found waldo"
(it contains the needed value)
bear`
what is the_field returning?
iSRAELi
http://www.livefootballtickets.com/english-premiership-crystal-palace-v-manchester-city-tickets/london-18412.html
os-11258
I understand this is #php and not #gearman ; but does anyone know if one runs: "php worker.php" how many concurrent jobs it can handle?
iSRAELi
this value
the above url
laszlof
iSRAELi: dump out the contents of $s1 with var_dump
iSRAELi
var_dump(the_field('site1-link'));
?
bear`
iSRAELi: because laszlof because the string livefootballtickets is in the URL
         

iSRAELi
i`m a very beginner in the php world, i apolegize for weird questions
os-11258
should be "yesterdaysfootballtickets"
iSRAELi
http://www.livefootballtickets.com/english-premiership-crystal-palace-v-manchester-city-tickets/london-18412.htmlNULL
this is the value i got
bear`
iSRAELi: http://codepad.viper-7.com/TMu3Ym
edwardly
os-11258, each worker can run one job
iSRAELi
bool(true)
os-11258
ah; so I have to execute multiple workers
:(
iSRAELi
bear, i got bool(true)
edwardly
if you want multiple workers, yeah
os-11258
and gearman is smart enough if i run: php worker.php a dozen times on one machine, to pick one tha tisn't being used?
bear`
iSRAELi: are the values for s1 (evaluated) and string correct?
iSRAELi
yes, it found the text in the url
bear`
iSRAELi: that's why it is true
http://codepad.viper-7.com/09nmwW iSRAELi
it echoes 'I found Walso!'
Waldo*
iSRAELi
thanks bear,
very much
bear`
np
iSRAELi
won`t the "the_field" work though?
i need to read the content from the field
and compare to one of the string#
bear`
iSRAELi: I presume the the_field function returns null, which is why it won't work, or it returns something else
can you provide the code for it?
iSRAELi
its something in wordpress i believe, the guy who built my website used:
<?php the_field('site1-link'); ?>
and it works perfectly
it shows the correct value
bear`
iSRAELi: I guess that the method echoes the result?
iSRAELi
yep
         

bear`
iSRAELi: it needs to return it, i.e return "http://www.livefootballtickets.com/english-premiership-crystal-palace-v-manchester-city-tickets/london-18412.html"
you can get the echoed output into a variable, but I wouldn't suggest you do that
echo only prints the value to the output, it doesn't return it or pass it out of the function
iSRAELi
the final echo, the result i want to print, is actually a 3rd party function, and not just the "i found waldo"
but before i got to it, i couldn`t bring the "the_field" into a variable, so i can send it to the function
bear`
hmm
Naktibalda
iSRAELi: ob_start(); the_field(); $variable = ob_get_clean();
bear`
so it justs outputs the link ... ok, not bery useful
you'll need to do that Naktibalda said
capture it in the output buffers (ob)
iSRAELi
i`ll try to reupload the code that i was sure to work
one sec
oh, your`e saying that "the_field" acts as an "echo" command?
bear`
iSRAELi: http://codepad.viper-7.com/Y1dtPV
yeah iSRAELi
iSRAELi: my code there fixes it for now
but it's not the most acceptable solution for the problem :)
iSRAELi
i should basically follow "the_field" command, and see it's behavior to figure what function i should use
sure, i understand buffer is a rather uncommon solution :D
bear`, dreamweaver shows an error in:
$s1 = ob_get_clean();
hrusti
is subdomain url more appropriate than slash(/) url? e.g. https://api.mydomain.com vs. https://mydomain.com/api
bear`
iSRAELi: http://codepad.viper-7.com/Xij1IP
forgot a ;
after the_field(...)
iSRAELi
missed it as well :D
amazing, works PERFECTLY! :D
thank you very much sir
bear`
np
Exagone313
hrusti: if you have a wildcard, you can use the first
mchelen1
hrusti: there is no one "appropriate" solution, it depends on the situation
for totally seperate codebases, sometimes it nice to use subdomains
hrusti
ok but it is app and api for this app
because frontend will be made in angular and backend is php
jkoudys
is there any functional difference between `(int) $foo` and `intval($foo)`?
laszlof
maybe if you pass it an array
notchris
alright got rid of Mamp
And just installed LAMP normally
laszlof
jkoudys: also, this http://stackoverflow.com/questions/1912599/is-there-any-particular-difference-between-intval-and-casting-to-int-int-x
jkoudys
laszlof, yeah, the top answer I already knew, but I was curious about something slightly difference
specifically if not specifying a base, if there's a diff
notchris
Has anyone here ever connected to an mssql db via PHP on OSX?
jkoudys
laszlof, array's a good thought, but this is true: ((int) [4,5,6]) === (intval([4,5,6]))
notchris
Or got it working?
NoiseEee
notchris: lol
in what world can that possibly represent an appropriate deployment
notchris
NoiseEee: I ask because it seems like a super hard setup
NoiseEee
notchris: its ridiculous.
notchris
I realize this, but my options are limited.
I cant alter the DB type
And I have to pull basic info from it
Maybe I should take the node route?
1 2 3 4 5 6 next »