IRC Networks
Irc Logs Stats
Start date: 2007-09-27 02:48:27
Last update: 2008-10-24 20:19:38
Channels: 41
Logged Lines: 6230436
Size: 1952.35 MB
Powered by
Channel Info
Network: freenodeChannel: #php |
Search in www.irclog.org
Log from #php at freenode 2006-07-22
Pages: 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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
Next >
[00:00]<yvzn2rf>str_replace('The product name is: ', '', $string);
[00:00]<suruzr>lol
[00:00]<suruzr>but its right
[00:00]<sfddjvxd>I think he is saying that the "the product name" bit of his string will change
[00:00]<rrvaxswyrr>well, no
[00:00]<sfddjvxd>and he would like to know how to grab the last token before the end of the string
[00:00]<rrvaxswyrr>I think that will work
[00:01]<sfddjvxd>oh
[00:01]<sfddjvxd>:p
[00:01]<rcrgjwg>there is a way to split a string to multiple lines? like "ABCD... other line ...EFGH"; ?!
[00:01]<rrppygrvnm>akano1n: based on what?
[00:02]<yvzn2rf>caffinated: i htink 4 characters :)
[00:02]<sajvnly>is there a good disciption on how to use string patterns for preg_split()?
[00:02]<rrvaxswyrr>$string = "Product name: Bouncy Ball [in a case of 6]";
[00:02]<rrvaxswyrr>I want to keep Bouncy Ball
[00:02]<rrppygrvnm>akano1n: http://php.net/chunk_split if you're doing it by length
[00:02]<rrppygrvnm>akano1n: there is also http://php.net/wordwrap which has slightly different functionality
[00:02]<m2n>sucura, How do I echo out it with 2 decimals?
[00:02]<rcrgjwg>caffinated, QUERY string, sometimes its BIG, and with multiple lines you can make things more cleary to read
[00:03]<sfddjvxd>number_fromat()
[00:03]<sfddjvxd>*number_fromat
[00:03]<sfddjvxd>lol
[00:03]<sfddjvxd>*number_format
[00:03]<yvzn2rf>preg_match('/[a-zA-Z]: (.*?) \[[(.*?)]\]/', $string, $matches); print_r($matches);
[00:03]<rrppygrvnm>akano1n: ah, that will probably be somewhat more difficult, as you will need to determine where an acceptable split point is.
[00:03]<sajvnly>yeah itrebal i have no clue how to do that :(
[00:04]<rrvaxswyrr>itrebal: ok, that will give me the whole line into an array, correct?
[00:04]<rrppygrvnm>akano1n: or were you speaking of URLs?
[00:04]<yvzn2rf>Scotepi: heh, i was answering natchswing's question
[00:04]<yvzn2rf>natchswing: try it
[00:04]<sajvnly>well :(
[00:04]<yvzn2rf>Scotepi: regular-expressions.info
[00:04]<sajvnly>k
[00:04]<rrppygrvnm>akano1n: in the case of a URL, i'd use parse_url() to extract the host name, and just use that for the display portion.
[00:05]<rcrgjwg>no, QUERY string, select ............
[00:05]<yvzn2rf>akano1n: there is no easy way to do that
[00:05]<rrvaxswyrr>itrebal: I think I need a space in the brackets, right?
[00:05]<rrvaxswyrr>(first set)
[00:05]<sfddjvxd>no
[00:05]<crdvfdg>Can someone look at this and tell me what I did wrong that the varibles are not being set? (It's only 15 lines.) http://rogue.homelinux.org:81/~kaitlyn/files/code.txt
[00:06]<rrppygrvnm>akano1n: if your queries are hard coded, just insert line breaks while you're writing them. if they're generated, then, as itrebal said, there is no easy way. you'll have to roll your own.
[00:06]<m2n>How do I echo out 2.3 from a variable that has the value 2.311388298?
[00:06]<sfddjvxd>number_format
[00:06]<rcrgjwg>ok
[00:06]<rrvaxswyrr>I'm getting an empty array
[00:06]<m2n>slimothy, I didn't find it very useful.
[00:06]<eenm|eee>dbe, rtfm
[00:07]<sfddjvxd>then use round()
[00:07]<sfddjvxd>round(2.311388298, 1);
[00:07]<sfddjvxd>the 1 means 1 decimal place
[00:07]<m2n>archivist, Don't rtfm me, it was 1 years since someone did that =). Damn.
[00:07]<zdzg|wjzc>kaitlyn: you need to read up on <input> tags
[00:07]<eenm|eee>http://tr2.php.net/manual/en/function.number-format.php
[00:07]<sfddjvxd>you will of course lose precision
[00:07]<m2n>ared|zzz, , Don't rtfm me, it was 1 years since someone did that =). Damn.
[00:07]<m2n>sorry =).
[00:08]<yvzn2rf>natchswing: sorry, i can't help further, i must be off
[00:08]<rrvaxswyrr>this php regex seems different that regular regex
[00:08]<rrppygrvnm>you have to be somewhat careful with number rounding. number_format, round, ceil, floor .. they all act a little differently.
[00:08]<zzaxyvysv>dbe read how to use nick complete
[00:08]<rfnwn>dbe read the manual on that
[00:08]<sfddjvxd>tab
[00:08]<zdzg|wjzc>kaitlyn: a better way to do password inptus is EX: <input type="password" name="password1" />
[00:08]<m2n>Muhaha.
[00:09]<nuzncr>how do I divide sections of a site based on percentage so that contents won't be overlapping?
[00:09]<rrppygrvnm>Eureka: #web please
[00:09]<yvzn2rf>or <input type="password" name="password[1]" /> to keep them in a nifty array
[00:09]<rrppygrvnm>Eureka: that's a display issue.
[00:09]<zdzg|wjzc>itrebal: :D !
[00:09]<crdvfdg>ryan|work: Thanks. Can you tell me what it's not being set though?
[00:09]<rfnwn>wow kaitlyn, that's some bad code
[00:10]<zdzg|wjzc>kaitlyn: replace your id= to name=
[00:10]<zdzg|wjzc>in the <input> tages
[00:10]<zdzg|wjzc>* tags
[00:10]<crdvfdg>^_^
[00:10]<crdvfdg>Thanks ryan|work. :)
[00:10]<zdzg|wjzc>np
[00:10]<suruzr>do I have to put ob_end_flush() at the bottom of my file when I use ob_start() ?
[00:11]<rfnwn>and don't use require() on a php file you plan on parsing
[00:11]<rrvaxswyrr>what does (.*?) mean in preg_match?
[00:11]<rfnwn>sucura: yeah if you want it to output
[00:11]<rrppygrvnm>match any character 0 or more times, ungreedy
[00:11]<rrvaxswyrr>why isn't it just .*
[00:11]<rrppygrvnm>unless the 's' modifier is given, 'any' will not include linebreaks.
[00:11]<rrvaxswyrr>"ungreedy"
[00:12]<rrvaxswyrr>hmmm...
[00:12]<rrppygrvnm>ungreedy means it will not swallow to the last matching character. it will stop at the first.
[00:12]<jufyzg|wjzc>www.regular-expressions.info <-
[00:12]<jufyzg|wjzc>Read, learn, love.
[00:12]<rrvaxswyrr>yeah...
[00:13]<sfddjvxd>or copy, paste, steal :p
[00:13]<rrvaxswyrr>I have tao of regex bookmarked
[00:13]<rrvaxswyrr>but it seems that php does things a little differently
[00:13]<rrppygrvnm>natchswing: yes, it is not 1:1 with the perl implementation. but enough is there that it is close.
[00:14]<suruzr>alexE: but doesn't it output automatically?
[00:14]<rrppygrvnm>natchswing: also, conceptually speaking, most things should be portable in one form or another.
[00:15]<z00svnz>wow, this php script has taken over an hour.
[00:15]<z00svnz>the browser has long since come up as "done." but it's still running.
[00:15]<z00svnz>what a mess this little project has turned out to be.
[00:15]<rrvaxswyrr>damn...







