logs archiveIRC Archive / Freenode / #php / 2015 / September / 3 / 1
noahmg123
:P Nevermind, turns out the second funstion does not return anything
DissidentRage
well, anyone who expects something like that to be done overnight shouldn't be in a position to make demands of IT
or demands of any capacity
noahmg123
can I use an if inside a urlencode?
Naktibalda
noahmg123: no
DissidentRage
wat
noahmg123
Naktibalda: thx
DissidentRage: was that to me?
Naktibalda
noahmg123: !+ternary
php-bot
noahmg123, [ternary] Like many other languages, PHP has a ternary operator (?:). It serves as a compact if/else syntax. See http://www.php.net/manual/en/language.operators.comparison.php
DissidentRage
yeah just wondering what you're trying to accomplish that needs that
         

Naktibalda
but I recommend doing that logic in multiple lines
Simon1234
Unless you want to obsfucate
caffinated
should change that. calling ternary "a compacy if/else" is a bit misleading. the two are not really the same.
Gatomon
compacy if/else. Mmmmm :+)
Tricky_Di
?: ternary is an expression, while if/else is a statement
caffinated
exactly.
more accurately, it's an operator that can be used in an expression.
Tricky_Di
"forms an expression" then? :)
Gatomon
(Action) waits for caffinated to update the factoid.
rinoros
hello there, someone could help me to inquiry what is wrong with my environment on ubuntu, using aptana studio?
Gatomon
rinoros, who said there was anything wrong with your environment?
What do you think is wrong with it?
Which version of PHP is installed on it?
thebuccaneersden
*crickets*
rinoros
Gatmon: its the 5.5
Gatomon: I really dont know if its something with the environment, I was following a config tutorial
mchelen1
whats the bot command about how to ask a good question?
rinoros
Gatomon: but in the last steps, didn't work as expected
Sammitch
mchelen1: pm it a help command
Simon1234
Okay, I tapped brew installs for PHP update, but there are a zillion of them. How do I choose?
caffinated
rinoros: you still haven't actually outlined what the problem is.
Simon1234
And by zillion, I mean 10-150
caffinated
rinoros: as much as we like to claim claravoyance around here, they're not typically powers we have access to.
rinoros
caffinated: sure, I'm working on it
         

mchelen1
Sammitch: ok ty
Simon1234
Claravoyance?
rinoros
if I get the tutorial right (https://goo.gl/ECiNU5), in the last step it should change the perspective on aptana studio, to debug one, I think
caffinated
Simon1234: it's like ESP. being able to know something without having any logical means to gain that knowledge.
Simon1234
ESP?
caffinated
extra sensory perception
is google broken for you?
Simon1234
Ah...
Vooloo
I have two arrays and I want to make it fail if array 1 has array keys that are not in array 2. what method do I need to use?
AcidReign
Vooloo: !+array_diff_key
php-bot
Vooloo, array array_diff_key(array arr1, array arr2 [, array ...]) - Returns the entries of arr1 that have keys which are not present in any of the others arguments. This function is like array_diff() but works on the keys instead of the values. The associativity is preserved. - http://php.net/array_diff_key
AcidReign
Vooloo: of !+array_intersect_key
php-bot
Vooloo: of, array array_intersect_key(array arr1, array arr2 [, array ...]) - Returns the entries of arr1 that have keys which are present in all the other arguments. Kind of equivalent to array_diff(array_keys($arr1), array_keys($arr2)[,array_keys(...)]). Equivalent of array_intersect_assoc() but does not do compare of the data. - http://php.net/array_intersect_key
AcidReign
s/of/or/
ecart
Hello everyone,
how to define a range for each round of a " loop " ?
"for loop"
caffinated
you mean loop from value x to value y?
ecart
yes
caffinated
for ($x = $start; $x <= $end; $x++) { .. }
where $start and $end are integers
roswell
and <= will include the $end, while < won't
caffinated
right. it's less than or equal to.
ecart
no no
I know it
look at my code
roswell
DONT POST IT HERE
caffinated
roswell: calm down.
roswell
im just giving a warn, mate
ecart
http://paste.ofcode.org/3aJzk9T6Xq6nvx4jrefwmtP
caffinated
ecart: ok, I'm not seeing the problem
well, maybe one problem
modifying $cs like that doesn't update the array
TML
ecart: If you're asking how to have foreach not iterate all the values in the $cats or $cc arrays, use something like array_slice or array_splice to create the array you want before going into foreach
alternately, you can use 'continue' within the foreach loop to exit a given iteration
ecart
I 'm posting data via curl
I need to wait for the site 's response.
then the " foreach " is the count , and sends the information (following the normal order of the array) , each time the recipient to respond.
it is possible to put this interval ?
I have a string like this:
yyyyyyyyyyyyyyyy
I want you to be like this:
yyyy/yyyy/yyyy/yyyy
what do I do?
php-bot
Muting ecart for 20 seconds to prevent them from flooding
TML
ecart: So you just want a slash every 4th character?
ecart
s
TML
ecart: echo chunk_split($str, 4, '/')
carpii
Im migrating my website to fully HTTPS, but one problem is that my PHP based forums allow embedding of arbitrary images, often hosted on non-HTTPS sites. How do I avoid mixed-content browser warnings for this? All i can think is that I have to have a server with a PHP script which downloads the image from the original host, and then serves it under my SSL certificate, but its not ideal. Seems like this problem must have been solv
by many people already. Any advice please?
TML
carpii: The most common solution I see is "Use protocol-relative URLs and, if it's not available by SSL, too bad."
carpii
just allow the browser to spit out mixed content warnings?
TML
No, in the case of protocol-relative URLs, it will try to connect to the other end with SSL, and if it's not available by SSL, you get a broken image
carpii
chrome doesnt seem to do much other than turn the lock icon yellow. Im not sure about other browsers these days, I know IE used to pop up a horrible modal dialog
ah
not sure that will be suitable, as many sites will not have SSL
__adrian
tell them you'll stop linking their content if they don't get ssl!
that'll teach 'em
carpii
they wont care :) its arbitrary sites
id be happy to allow the images to 404 if my users understood it, but 90% of them will just assume its a problem with my site
__adrian
</irony data-type="lost">
carpii
:p
ok
TML
__adrian: That was a terrible show, and you should be ashamed for referencing it
__adrian
haha
« prev 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 next »