logs archiveIRC Archive / Freenode / #php / 2006 / June / 8 / 1
richardlynch
m-00kie: No, you'd get abgc because a is 0 position.
Kurrasoe
so apahe
m-00kie
well yeah
richardlynch
abgd, sorry.
Kurrasoe
apache
m-00kie
im getting strange behaviour though
i have
ak_work
hi, im new at XML, its complete diferent simplexml and xml parser ?!
m-00kie
$_f='00000'; echo $_f[0]; it echos null
tdd1984
http://pastebin.com/766120
richardlynch: here look at that cause i had the lines messed up
what line should i put that syntax on now?
         

Burian
I changed my max file size in my php.ini folder to 9 mb and it will still only allow me to upload 2....is there anything else to change?
m-00kie
any idea why it doesnt seem to work?
cynic
m-00kie: It works fine for me... must be something else.
Time to run though, bye!
CalvadoS
Hello, php-mysql can get a sql queries execution time ?
richardlynch
m-00kie: http://pastebin.com/766127
CalvadoS: You can either use SQL commands to get the time, if your DB has them, or you can use microtime() before/after, which includes the tiny overhead of PHP sending query.
CalvadoS
hmm
tdd1984
richardlync: did you get the new pastebin i posted?
CalvadoS
well when I select something from mysql it returns 1 row in set (1.00 sec) after result
m-00kie
richardlynch - http://pastebin.com/766135
that's printing:
F:
OVER: /0,
however if i move the F: line to above the if(()&&()) line, it prints fine
ak_work
hi, i would like to know if simplexml is completely diferent from xml(expat), or simplexml is a easy way to use xml instead of xml parser (expat).
richardlynch
m-00kie: First, you should not use $_f, I don't think.
korkl
m-00kie, why do you use if() : and not if() { } ? is that even legal?
m-00kie
richardlynch - why not?
korkl - huh?
cuban
hey all, I need to do two things in a variable.. how can I do that? I've looked all over the docs... IE: $currentdir=ltrim(dirname(__FILE__),substr(d:\testtest\test,0,3));. That removes d:\. I'd like to append a / before the output of $currentdir
richardlynch
m-00kie: Reserved for PHP superglobals
korkl
m-00kie, sorry that was meant for richardlynch
m-00kie
richardlynch - no, there's only 9 or so superglobals reserved in php
richardlynch
I do not use the alternate syntax.
m-00kie: I'm pretty sure PHP has reserved the right to create MORE superglobals someday, and $_ is for them.
ak_work
cuban why don you use ereg_replace()
m-00kie
well it works fine, until that if(()&&()) line
i cant see WHY its breaking at that line..
         

e-head
I have some pointer/reference questions.
$a =& $b. Can reference assignments like this be used on arrays as well as objects ?
ak_work
there is eregi_replace() for case insensitive
richardlynch
m-00kie: The reason that you get NULL is that '00000' turns into the integer 0, and then you try to index an integer as an array. Make it be $_f = (string) '000000';
cuban
ak_work you mean like... $currentdir=ereg_replace(substr(dirname(__FILE__),"","321"));
m-00kie
"\0" is null, not '00000' .. PHP doesnt even translate if you use single quotes, also..
sylow
hi, I have a search form with many options, any tips about why approach this through post or get requests? And.. avoiding a long file with lot's of if statements?
richardlynch
m-00kie: You're right, it's not a conversion thing here. Tho PHP will convert when it sees fit...
BrutusUnix
is it possible to use odbc connection to a remote database?
ak_work
cuban ereg is regular expression, it search for a pattern and replaces that pattern, for everything that you want.
you can search for d:/ and replace for /
cuban
ak_work yes I'm aware but this should work should it not?
m-00kie
well i converted "$_f" to "$gf", and still have the same problem
$gf is echoing correctly ("00000") prior to the if(()&&())
cuban
ak_work: $currentdir=ereg_replace(substr("d:\test\test\test321",0,3),"","321");
richardlynch
m-00kie: Yes. I have no idea why it is behaving so strangely. Change 00000 to 11111 and what do you get?
m-00kie
same result
Nathe
I know php supports $function($foo), but does does that support extend to methods?
ak_work
cuban what do you want to do? replace d:
ops, d:\ for / ?
richardlynch
Nathe: Try it and see.
m-00kie: I dunno why they broke it, but use substr. :-)
sylow
Nathe: php.net/func_get_args
Nathe: ah.. you mean methods in classes , that works too
Nathe
sylow: yeah I'm registering a callback function, and the majority, but not all of them are going to be methods
ehh. nm I just answered my question
blah
sylow
:)
Nathe
sorry.. 4 hours of sleep and not enough cafffine
or caffine for that matter
e-head
What does the & in the function definition "function &my_function()" imply ?
Wolfpaws
!+&
stormbot
[&] & is the PHP 'Reference' operator. See: http://php.net/references; & is Also the PHP bitwise AND operator. See: http://php.net/manual/en/language.operators.bitwise.php
e-head
thanks
Does php4 have any awareness of static member functions ?
Nathe
richardlynch: yeah but that meens I have to actually work **whine** :P (I figured out a better way to do it anyway
Wolfpaws
e-head: no.
e-head
I can execute class method functions using MyClass::method() though. Is this just class/OOP sloppiness in php4 ?
Julian|Work
It's a static call.
Wolfpaws
e-head: php.net/oop
e-head
thanks
richardlynch
e-head: You can use static methods, and the 'work' but you can't declare them, and there's no enforcement of not mixing static and non-static, and if you manage to pass $this around and then use it, on your head be the results.
e-head
Thanks richardlynch. It's sort of self-regulated then.
Nathe
richardlynch: that'd be some funny stuff :/
cuban
What does this mean... "Warning: ereg_replace() [function.ereg-replace]: REG_EESCAPE in /cusource2/index.php on line 6"
Xyphoid
i can just see someone designing a system where you store your instances in a registry so that when you do static calls on nonstatic methods it can look up an instance to use
mwiggins
is there any way to trap a fatal error from require_once() ? i just want to get a backtrace and then die
s|k
Can I have static classes where I use the static keyword for the entire class?
hrm
the manual says nothing about it
probably not possible
mwiggins
to define a class where all methods are static? itd be fine if you did it explicitly
s|k
can I do: static class myClass {
mwiggins
so that each member is static implicitly? no
s|k
I see
Shane_N
Hello
richardlynch_
s|k: static class xyz might be on the road map for PHP 6... Google PHP 6 Roadmap if you want to find out...
mwiggins
any way to catch a Fatal Error as an exception?
s|k
richardlynch_: thanks
Shane_N
Are there known issues with the sybase module lagging out of no where? I've been using it for months, and today, without touching configuration of it, it takes 2-3 seconds just to connect. I'm the only user who uses the server, and I'm not running anything crazy on it
mwiggins: not yet (last time I checked)
s|k
I'm creating my xhtml documents with php5's DOM
and I have this class where I'm just calling static methods to create elements
like if I wanted a header element I'd call getXHTMLElement::getHeader();
well
getXHTMLElement::getHeader($textNode);
mwiggins
sounds like a namespace
which also arent in php
s|k
and the entire class is just full of static methods
no I'm just using xhtml, no other namespaces
richardlynch_
s|k: Okay, all your methods are static. Fine.
GoSox
if no POST variables are set at all when loading a page, will isset($_POST) be false?
mwiggins
count(array_keys($_POST)) will be < 1
richardlynch_
GoSox: No, it will have count($_POST) === 0 though...
GoSox
oh cool
philip
empty($_POST)
richardlynch_
empty changed its meaning too often for my tastes, personally.
Shane_N
or sizeof($_POST) === 0 :)
GoSox
what did empty USED to mean?
philip
it changed once, from php3 :)
richardlynch_
philip: Try again. It changed in PHP5 as well.
mrkris
i am parsing sme html, and i am having issues grabbing all content between <!--start here-->(.*)<!--End Here--> i look at the source in vi and see ^M and am thinking that's what is causing it to fail
philip
empty('0') was false in php 3, what changed this time?
Nathe
mrkris: yeah that'll do it .. wrote it in notepad did you?
||cw
mrkris: ^M is a \r\n
mrkris
no, someone else. how do i strip ^M ?
richardlynch_
class foo { }; $foo = new foo(); echo empty($foo);
mrkris
I did strip \r\n
and tried the octal
but no dice
richardlynch_
mrkris: Maybe try using /s and /m for the preg, so newlines don't matter.
mwiggins
:%s/C-vC-m$// in vim
||cw
mrkris: the ^M is fine, you just need to let your regex match across newlines
mwiggins
but yeah multiline regex
||cw
mrkris: maybe it;s just \r?
mrkris
richardlynch_: lemme try
richardlynch_: that worked, thanks :)
lig
g'day
Wolfpaws
g'night.
richardlynch
Gah! I just spent 15 minutes figuring out that '/(\\b)($word)(\\b)/ism' needed " instead of ' ! sigh.
Kurrasoe
hey richardlynch
richardlynch
Kurrasoe: What?
ak_work
cuban is that want you want, eregi_replace("d:\\\\", "/", $string)
cuban output -> /test\test\test321
airwave
I'm setting up a query, like this: query="INSERT into myTable (col1,col2) VALUES ($val1,$val2)" --- my question is what if $val1 and $val2 have parenthesis or quotations? Will that mess up the query when I do: mysql_query($query)? If so, how do I fix it while retaining the parenthesis and the quotes. is there a way of escaping it?
richardlynch
airwave: http://php.net/mysql_real_escape_string is your saviour. Required reading: http://phpsec.org
Jymmm
anyone else got their google spreadsheet invite yet?
richardlynch
Jymmm: Hunh?
airwave
Jymmm: I have
Jymmm
airwave you find it slow?
« 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 »