| |
| |
| |
|
Page: 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 26 27
Comments:
<0> hawkaloogie: ? <1> you're actually asking this? <2> lol <0> Yes, i cant find any document on how to calculate, this. <1> a percentage is a ratio out of 100 <1> because this is a basic math skill <1> like adding and subtracting <3> oh boy <0> Yes, but how can i put this to work with php.... <4> yes,it is eash <4> easy <1> well... if you have 100 people polled, and 40 said yes, then 40 / 100 said yes <1> so 40% <1> so if you have 20 people polled, and 2 said yes, then 2 / 20 people said yes, so 0.10 or 10% <0> yes, but how do i take this in to php? i have been searching for a "tut" or a documentation about this. <1> okay, now you're basically telling me you don't know PHP at all
<2> x1/total * 100 <1> luckily, neither do i <1> would it be print(x1/total *100); or echo(); ? <4> i think you must read doc in www.php.com <3> I can't believe you people are seriously answering this <1> it's fun! <2> echo $total==0 ? "div with 0 not allowed" : $x/$total * 100 ."%"; <5> when I'm in a cl***, how can I call a function from the parent cl***? <6> parent::foo() <5> thx <7> you can use the name of the parent cl*** aswell cant you? <6> self, parent etc work better <6> -> if you refactor and rename your cl***es, your code doesn't break <7> yeah of course, just suggesting more options <8> hi can i use " ^[0-9]*\.[0-9]* " to match 234.45 ? <9> have you tried? <8> not yet <8> :-) <9> then try it <9> :-) <10> nandan: sure, but it would also match "." <8> codethief: i need to match dot also <10> dunno whether this side effect is desired <10> than it should work properly <11> nandan + is 1 or more matches * is 0 or more. <10> *than = then <10> @row: "<8> codethief: i need to match dot also" <12> Is their a php command that will allow the code to read the name of the file? <12> like i had randomname.php can i get a php command to read the file name is randomname.php? <13> I everyone, the company I work for encode their PHP when we deploy. The thing is we have a number of XML files that are used for configuration. At the minute we are thinking of using a script to convert our XML to PHP arrays but that sounds rubbish to me. Is there any way I can encode XML? <3> "encode"? <3> what's the -point- of storing data in XML if no one but your software should be able to read it? <13> because we need to read and change it mst <13> but our customers shouldn't <3> well, disregarding my personal feelings towards such an idea, you have pretty much everything available to you, including mcrypt <14> hi, im using file_get_contents() to read a large file (300MB) into a string. but i only want the last 64KB of the file. i used offset with filesize - 65000, but i still get memory usage > 64MB errors <14> what am i doing wrong? <3> use fopen/fseek/fread <15> How do I check a string for whitespaces? <14> mst: but isnt offset meant to skip x-bytes ? <14> why does php still tries to read the whole file? <13> mst: I'm not keen on it either but I'm new to the job :) , I'll check out mcryt though. Thanks <15> I need to make sure that my string doesn't contain spaces... <14> beruic: use str_replace <14> $string = str_replace(' ','',$string); <3> fluffles: because it's file_get_contents, the whole point and performance benefit of which is to read the whole file, buffered <14> mst: so why is the offset there? :( <14> *spanks php* <14> anyway, ill try the other functions <15> fluffles: I need to have a TRUE or FALSE returned... <13> beruic: use a regular expression <13> p_reg_match or something <14> beruic: use strpos ? <15> themoves: Isn't there a way the uses less lines? and I'm not good with those yet... <14> will return false or an integer, if integer you need to convert to boolean true <3> beruic: return preg_match('/ /', $string); <3> how much less than that do you really need <15> fluffles: I'll take a look at it ... <13> less lines? er, if(p_reg_match('/ /', $string)){, beruic one line! <15> mst: if(my test)
<14> mst: regexps arent for everyone.. :( <3> if (preg_match('/ /', $string)) <14> personally i hate regexps, but i love their strength :) <15> Thx guys :) <3> regexps are the duct tape of the internet <15> I feel the same way fluf :) <13> beruic: they are easy!! Read a few tutorials and you'll see the power and love them <13> They don't need to look like line noise to be useful <15> themoves: Time my friend... So esseintial. Maybe next month :-P <13> beruic: indeed. Good luck <16> hm <16> I've never done regexps <17> hello everyone in the awesome php channel <12> Dont worry, workd out my problem <17> is there any way I can set a variable in a script when I call it from the command line? <12> $filename = "subdir/" . $path_parts["basename"] . ".txt" ; <15> Think I go for the regexp, then I can chack for other characters too :) <15> Then I should use if(p_reg_match('/[!"#%&/()=?@${[]}|+]/', $string)), right? <12> Did u still include your space in there? <12> I thought thats what you were looking for in the first place :/ <15> You are right. Stupid me :) <15> Can anyone see any mistakes?: if(p_reg_match('/[ !"#%&/()=?@${[]}|+]/', $string)) <3> p_reg_match() is not a real function? <13> shiznatix: argv <15> it's should be preg_match :) <15> Now then: if(preg_match('/[ !"#%&/()=?@${[]}|+]/', $string)) <3> quote the [s <15> ? <3> you can't have [ asasdsd[asdasd]adasd] <15> Show me... <6> \[\] <15> Ah... <15> Shouldn't a space be \s too? <15> So it's: if(preg_match('/[\s!"#%&/()=?@${\[\]}|+]/', $string)) or what? <18> hello room i have been building a blog from scratch www.hertfordtown.info/blog.php <18> can any one help me work out how to put pictures in the entries <18> i know i need a folder on my server for the image <18> and a field in the db to record the url to the file <18> but havent got a clue how to code it really <19> I have a file name stored in a blob field as : ../../images/ddc/file.txt ! aslo this file is existing on a folder under /images. When I delete it I receive some error ! I get the file name from table by : $file = addslashes($row["DOC_FILENAME"]); and than I try to unlink with : if (unlink("\"".$file)."\"") but I receive an error even if the file is deleted ! anyone know why ? <20> ace_me: here's an idea, tell us the error message? <20> ace_me: I find it hard to believe that wasn't obvious <15> What's wrong?: if(preg_match('/[\s!"#%&/()=?@${\[\]}|+]/', $string)) <19> [function.unlink]: No such file or directory in D:\X_Site\project02\prog\admin\uploaddocumentation.php on line 39 <20> ace_me: ... okay so the file you're trying to unlink doesn't exist, that's pretty self explanatory too <0> hm.. how can i make my code, cut the output after the first . in a number?= <20> matthewcrane: break the problem down into bits, first tackle the image uploading, php.net/file-upload <19> but I've just told you that the file is deleted just with unlink <0> i have like 45.0094324 and 54.99023 and i want to just have the first 2 numbers. like 45 and 54 <19> but why the error ? <20> roniez: explode <20> ace_me: the file isn't there when unlink is run! <20> ace_me: maybe you're running unlink more than once? <19> whoe delete ithat than ? <19> aha <19> maybe <19> ok <19> I'll look again <19> thx <18> cheers aidan <21> how do i output a 'unsigned short' in php as binary? i.e. 1380 would be 0x05 0x64 (two bytes) <20> please don't spam the channel with 6 lines when "okay" was appropriate, ace_me <20> dongs: php.net/sprintf <19> k again <21> how does that help me. <21> i dont want it formatted, i want it output as bytes. <22> ace_me: let me guess.. you have a dir.. upload and a file documentation.php <20> you want the actual bytes output to the page? or you want 0x05 as text? <21> i want the actual bytes. <21> because its not going to a 'page'. <20> dongs: pack/unpack <21> k <21> that sounds more like it
Return to
#php or Go to some related
logs:
#lgp suse10.1 captive ubuntu phion qt4 lightweight spreadsheet #web #nvidia #gentoo #linux vncviewer: ConnectToTcpAddr: connect: No route to host libxcalibrate
|
|