logs archiveIRC Archive / Freenode / #php / 2006 / February / 27 / 1
Brendon
Can anyone tell me the regex to split unix folders? I'm using preg_split to split each folder into an array. So far everything i've tried is not working. Thanks in advance.
PktLoss
to split unix folders? can you expand on that?
Brendon
PktLoss: say i have a dir, "/some/folder", i want to split it into some and folder.
DjDarkman
can i crate files with php?if yes ,than how can i do that?
jonez
Brendon, regex prolly isn't the right tool.. try http://php.net/explode
PktLoss
cant you just explore with /
(explode)
Brendon
thanks i'll try that.
MrPHP
Hello everyone! Is there a way to check if a string is UTF-8 or not? I've tried a few suggestions on php.net but they dont seem to work (Even latin1 strings are interpreted as utf-8)
PktLoss
I'm under the impression that determining the charecter set of a given string is very difficult to do accuratly
         

DjDarkman
can i crate files with php?if yes ,than how can i do that?
lmuch
file_put_contents() ;)
and yes of course
eml
what function to use if I wan't to make a case-insensitive match on two strings?
Psi-Jack
Oy.. Why does PHP's imap_* functions suck, and have to use some annoying {remote_name} crap with it? heh
KYPE
eml preg_match works
preg_match('/string1|string2/i',$string);
should work
eml
$string would be what then
KYPE
HMMMMMMMMMMMMMMMMMMMMMMMM
eml
sorry =
=) php.net it is
if ( preg_match ( $_POST['usr_name'], $row['usr_name'] ) ) like this? (also, can I do an if like that on an array?)
Tweakin
err why use a function for such a basic comparison? what not if ($a === $b) { ... }
?
don't make things more complicated then they need to be :)
eml
well that wouldn't be case-insensitive wouldn't it? (question.)
Stormchaser
eml: how about strtolower($string) == strtolower($string2)?
eml
ok then :)
Stormchaser
Kids these days... No imagination, I tell you... NO imagination!
eml
thanks
Stormchaser
hi, lig!
eml
=))
Tweakin
odd, i always thought === was case sensative
Stormchaser
...
Tweakin
== was not
eml
oh, sorry
         

Jymmm
eml: didnt you ask that same questiont he other day?
Tweakin
(Action) goes to test
eml
Jymmm, no
Tweakin, thought you said ==
Jymmm
eml: Ok, musta been some other dumbass
eml
and it was a question
Jymmm, thanks
Jymmm
eml np
Tweakin
eml; it appears if (condition === condition) {} is case sensative
eml
ok, the strtolower way then
sturmflut
Tweakin: Sure it is
Tweakin
not needed, === compares case sensativity
Stormchaser
Tweakin: Please read the php.net/operators
sturmflut
== checks values, === checks values and types
Tweakin
so no need to make them both lower
eml
so you mean case-insensitive?
o.O
Jymmm
Tweakin you are WRONG
Stormchaser
ow, ow, ow. My head hurts
Tweakin
eh, i tested, it appears case sensative.... but the manual doesnt specifiy
there is of course a great chance i am wrong though :P
Stormchaser
...
eml
Tweakin, you mean insensitive+
Stormchaser
oh, ffs...
Tweakin
heh, my head officially hurts now too, i think i need to read up to the original question
Stormchaser
Tweakin: my head still does when I read your BS.
eml
yeah, I think you should.
Tweakin
(Action) slowly walks away
really dude, this 2 minute irc conversation hurts your head that bad? I think you need a nap
Jymmm
(Action) grabs the DUMBASS stamp and slaps it on Tweakin forehead, then hands eml the solvent remover.
eml
Jymmm, thank you, I think
Jymmm
eml I was kidding when I called YOU a dumbass, not so for others.
eml
ok.
Tweakin
and yes... i originally thought he said case sensative, i read to fast in my attempt to help someone
(Action) admits a mistake
Jymmm
Tweakin: Ok, so now for clarifiction of your mistake... what is the purpose of === compared to == ?
Tweakin you have sixty seconds
Darkkish_Box
oh oh
pick me
eml
(Action) answers: checks if they have the same type
Darkkish_Box
i know :-p
lol
Jymmm
eml are you Tweakin?
eml
yes
:(
ehm, dude. :[
you're scaring me :P
Jymmm
Tweakin come on now, what is the correct answer?
learn from your mistakes
30 seconds left
lig
hey Stormchaser - sorry I took so long - someone called me away
hey Jymmm
Jymmm
(Action) zips up his pants and thanks lig!
lig =)
lig
LOL
Dangermouse
lol
lig
(Action) spits ;)
tek
awwwwww come on
Dangermouse
ye, sure ;)
EricCartman-iBoo
what would be an easy way to eliminate characters which might cause trouble in the file names while saving them ?
rare some funky characters can cause problem, depending on the fs
rarely*
Jymmm
lig: drain bamage... I shipped it off w/o photographing it. It's been a rough couple of weeks.
lig
(Action) hugs Jymmm -
np darlin'
Jymmm
lig I have other if you want to see them?
lig
definately
Jymmm
lig
oak?
Jymmm
lig No, Mangaris
lig
(Action) has never heard of that
thin
what command do i need to do to download a webpage?
i tried fopen/fread cause i saw that in an example
but it didn't work
tek
to "download"?
thin
yeah, to fetch, to get..
tek
wget ?
=]
thin
sure but in php
tek
passthru('wget blah.com');
?
thin
i want to store it in a variable
tek
fgets I think
or file_get_contents()
thin
so i have to do fopen ($url, 'r') ?
cuz that doesn't seem to be working
tek
php.net/filegetcontents
cla
How do I include a file at runtime?
That is, a script running forever includes a file, and that file's content might change during the scripts execution...
thin
why doesn't this work?
$web = fopen($url[0], 'r');
$webdata = fread($web, 500000);
Silivrenion
*** Silivrenion has gone away (Reason: Away for a while)
eml
is_numeric ( $_POST['usr_tz'] ) ? $fld['usr_timezone'] = $_POST['usr_tz'] : ; <- not valid?
cla
eml: I think a $_POST can never be numeric.
afaik in_numeric checks the type of a var, not its content.
eml
hmm, good point :]
humm, what function to find out if the content of a string is a number then?
Euperia
is_numeric()
eml
so.. then it was valid?
except for the ": ;" part, I think
Ace-Hole
how can I run phpmyadmin on a page that's not online yet
ie I tried C:\program files\apache grou\apache2\htdocs3\phpmyadmin\index.php
instead of running it, it just opens it
and there is no "address" for it yet (as I am running 3 webpages on 1 server, local ip goes to another one of my pages)
eml
http://pastebin.com/574008 how would you solve something like this?
or, how did I fail? the count-part probably
cla
still, noone knows how to re-read an included file during runtime?
tim__
Hey everyone. Have a small problem that I can't figure out. When I inlcude a plain text file, the character "1" is appended to the end. Any idea why that would happen?
eml
ok, I fixed it, $i=1 instead if $i=0
SirFunk
is there a way to check if a certain index exists in an array, that won't throw a warning ?
tim__
Anyone any ideas?
GarethAdams
SirFunk: if(isset($var))
whether $var is a simple variable or array index
« 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 26 27 28 29 30 31 32 33 next »