| |
| |
| |
|
Page: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
Comments:
<0> kuhwallskee, php.net/types.string <1> Touqen: hehe.. I see now I didn't read it all... thanks. <2> thanks again deadroot & Gimp_ <3> Gibbonz: no problemo. <4> how would i say, strip 0's off a number <4> for example the number is 01 <4> and I want it to be 1 <3> preg_replace("0", "", $string); <3> or wait <5> (int)'000001' === 1 <3> he <6> use it as a number... <3> that works too <4> Gimp_, that wouldn't work if it was 10 <4> i'd end up with 1 <3> callipygous: good point.
<5> callipygous: Next time ask more clearly. Say you want to strip leading zeros. <4> les <4> 'leading' <4> how would I strip leading zeros'? <5> I gave you the answer. <4> oh ok <5> If you require a string, then you can just use ltrim() <4> an int will be fine <5> :) <4> i just don't understand the code <5> $int = (int)$str <7> kuja, is $str isnt a string, that will fail <6> not to be particularly dense - but where in the manual do they talk about using octal and hex numbers. I've looked in types and expressions and url searched using oct and octal.. no go. pointer please. <5> lig: octal is basically just \0nn where nn is a number. Hex is \xnn where nn is a number <4> seems odd int has () around it? <7> lig, $oct = 012 (note the leading zero), $hex = 0x02 <5> callipygous: Type casting <5> Ah right <5> I forgot about those octs <5> And hexes :) <4> type casting? <4> okay im out of it <6> understood kuja but did the zend self test and it had a question on octals - I of course missed it - so want to read up on it <5> lig: mfonda is also correct <5> lig: A number with a leading zero is octal. A number with a leading 0x is hex <5> \0 and \x is for characters, my bad. <6> so with the loose typing - how can it tell the difference with 078 and 78? <7> lig, it converts it to decimal <5> It will produce a number <5> kuja@shugotenshi:~$ php -r 'var_dump(078);' <5> int(7) <7> lig, for example, var_dump(012) == int(10) <5> callipygous: Typecasing is where you convert from one datatype to another. <5> callipygous: If you have a string '001', and you convert it to an int, ints can't have leading zeros, so they're stripped, thus you are resulted with just plain 1 <5> callipygous: You could even just do (string)(int)'001' too, if you want it to be a string. <6> now I'm really confused echo ('012'+1) gives me 13 but your var_dump mfonda is true <5> lig: '012' is a string. <7> lig '012' gets converted to 12 because its a string <5> When you tell PHP to add the string '012' to 1, it will need to convert it to an int. <6> so wait - if the "number" 012 is comverted to (int)10 but the string is taken and made decimal... <5> lig: octdec('012') + 1 <6> Hmm - so a form or DB that may have preceding zeros (say 1) that is returned is automatically considered to be a string... Damn that self test - making me question what I know. :) <8> so does anyone know the option that makes apache run a script - e.g. foo/test.php when i point my browser at /foo/test/bar/whatever ? im not sure if this is a php.ini problem or apache setup problem or what <9> you need to map the types <10> I'm trying to add PHP 5.1.2 to Apache 2.0.51 on Fedora and I've run into some trouble. Before I go into details, is this the right place to ask? <8> lokkju: i mean it's happening, and i don't want it to happen <9> akm, is it an apache problem, or an apache problem? <9> Agrajag-, uh, describe what you mean, specifically <10> I'm not sure where the problem is. It seems to be in Apache or PHP, as opposed to Fedora. When I add the LoadModule for php to httpd.conf it says, "Cannot load /usr/lib/httpd/modules/libphp5.so into server: /usr/lib/httpd/modules/libphp5.so: undefined symbol: _zend_list_delete" <11> index.php is giving 500 error, not sure what to look for or what problem is, can someone tell me? <9> adggg, look in your apache (I hope?) error log <9> also, if you configured it, there is a php error log <10> I've looked around on Google for that error message, and the only reference I found was not helpful. It says the problem may be in MySQL, but I tried their fix and it doesn't help. <8> lookju: i have a foo/test.php. i point my browser to /foo/test/anything/goes/here, and test.php is getting run. i *don't* want that to be the case - i want a 404 because /foo/test/anything/goes/here doesn't exist <9> akm, sounds like you are suing the wrong version of the module, or the wrong version of the server <11> yes, I have looked: http://pastebin.ca/44207 <11> lokkju: maybe you can see the problem there? <10> Hmmmm. The PHP readme file says it's compatible with Apache 2.0. <11> $_SERVER['HTTP_HOST'] <9> Agrajag-, no idea then - there is a thing that allows you to run ? as /, but with your issue, not sure - it is not default behavior
<9> akm, we are talking about your specific build of it <8> because im not even putting the .php in, just the script name without the php and a / afterwards, and it's getting run <10> Of Apache, or of PHP? <9> adggg, ok, is that your apache ERROR log, or your standard log? <9> akm, either <10> Okay. What would you suggest I do to isolate or otherwise fix the problem? <9> adggg, also, find your php error log <11> access log <9> akm, no idea <9> adggg, and I asked for your ERROR log <9> you may have to configure/enable it <9> akm, find a different build, perhaps <9> akm, or build your own <10> I built the PHP from source. Apache was preinstalled, so I'm not sure how it was configured. <11> lokkju: hold on, making a pastebin now <11> http://pastebin.ca/44211 <10> Is building Apache from source likely to help? <9> akm, no, you would do better to find just different binaries <11> "premature end of script headers" <9> adggg, yep, now look at your php ERROR log <9> (you could also test it by doing the following at the command line: <11> http://pastebin.ca/44211 <9> php /home/playbo4/public_html/index.php <9> and see what the error is <11> that's the eERROR log, no? <9> no, that is the apache error log <11> I don't have command line access, I'm ashamed to say <9> now we need the php error log <9> k <9> then you need to find the php error log <11> error log: http://pastebin.ca/44211 <11> no? <9> grr <9> PHP ERROR log <11> or what is the file called? <9> not apache <11> where can I find it? in which directory? <9> depends on your config <9> look in your php.ini, and see where it is configured to put it <11> okay, looking <1> ok. I'm using mysql_fetch_row to get an integer out of a table. It is defined in mysql as an integer(10) and before I fetch the row, I declare my variable using settype as an integer, but once I fetch the row var dump tells me it is a string(10). I know fetch_row returns an array, even if there is only one element, so why does var_dump tell me it is a string? Or better yet, why does it become a string? <1> And how do I make it be an integer? <9> try casting it? <1> lokkju: how so? int $somevar? <1> or in this case int $somearray[0]? <1> would it help to see the block of code? <12> any core php developers here? anyone knows how can I get in touch with members of the PHP project? <11> lokkju: can't find php.ini *embar***ed* <9> gubatron, uh, php.net? <13> ok people <11> how can I get the error logs? <13> has anyone made a custom page that interfaced with the Simple Machines forum database? I'd like to make a page that can use that login/p*** for the entire site, not just the forum itself <13> does that sound safe/feasible <11> can someone give me a hint on how to get php error log? <14> has anyone successfully used indent tool with php scripts.. i have 1000 and odd scripts to indent.. ? when i do $indent *.php .. ... it formats in an ugly way... should i p*** anycommand line options ? <11> how can I get the error logs? <15> vimman, create your own indent script <15> :D <16> Happy b'day EvilWalrus! <16> what are pre-requisites for learning PHP? <7> vimman, check out http://pear.php.net/package/PHP_Beautifier <5> Luckys, luckys from #ruby-lang? <1> I'm having a problem getting long2ip to convert my ugly numeric ips to dotted decimal ips... someone mind taking a look? <1> http://php.pastebin.com/579729 line 47-51 <17> hey guys, is there a simple function for generating guid/uuid's? <18> Redb3ard: i recall reading one in the manual <17> i cant find it, and not sure how to search for it, "guid" isnt much use as a keyword <18> Redb3ard: when you say uuid/guid, what do you mean? <18> is it this one? http://en.wikipedia.org/wiki/UUID <18> www.php.net/com_create_guid <19> Seeing as I am so utterly crap at regex, could you tell me the regex to find all instances of .swf in a page :) <17> /.*+\.swf.*+/g <17> or something like that
Return to
#php or Go to some related
logs:
genkernel ip_tables NOQUEUE: SYSERR(dspam) damnsmallinux partition xubuntu usb-keyboard bootsplash /proc/splash: no such file or directory #debian mcpu emt64 Could not initialize video filters #osdev kde mountiso suse
|
|