logs archiveIRC Archive / Freenode / #php / 2006 / June / 12 / 1
eatmypiano
Because you're a vacuum cleaner?
Touqen
perhaps
CyaNox
Touqen: echo '<a href="http://'.$liens.'">'.$liens.'</a>'; ?
sztanpet
php.net/explode
lietu
Inazad: $ar = explode("\n", $liens); foreach $liens ....
Touqen
CyaNox: wrong person
lietu
er, forexach($ar) ofcoz
Inazad
But, my vars $liens in the DB is like
www.rds.ca
CyaNox
Touqen: he he ... sorry
         

Inazad
www.google.ca
lietu, how I can write it ?
CyaNox
hten combine mine and lietu's example.
lietu
Inazad: http://php.net/explode
Touqen
ugh, I've got to call my mom and ask for money, i feel so pathetic.
lietu
Inazad: http://php.net/foreach
Inazad
lietu, I'm not good in english
lietu
or whatnuts
fourat
hello all
Gimp_
Inazad: $links = explode("\n", $lines); foreach($links as $key => $value) echo "<a href=\"$value\">$value</a>";
lietu
Inazad: well if there's a finnish translation of most php.net manuals there propably is a french one too
Inazad
ok
fourat
how can i parse a function, something like this : execute_php_code("$a = 1 + $b;");
Inazad
Gimp_, but $value is $liens ?
jiggster
there is indeed a french one
lietu
Inazad: no, it's not
Gimp_
Inazad: try it EXCACTLY as i just gave you.
it will work
Inazad
Gimp_, ok
Gimp_
Inazad: t'es fran├žais?
Inazad
Gimp_, oui , quebecois
jiggster
dear lord :p
         

lietu
oh my
jiggster
a "Canadian"
fourat
any help please ?
jiggster
fourat, you want to commit suicide by using exec()
Touqen
fourat: eval
jiggster
er
yeah
Gimp_
Inazad: ok, pour foreach, ca fais $array = array("key" => "value); oui? allors, un foreach, ca loop le array, et fait foreach($array as $key => $value)
jiggster
i'm out of the loop :p
eval exec, it's all the same to me
lietu
Gimp_: take it in private if you're planning on not using english, please?
Inazad
Gimp_, ok mais regarde
fourat
Touqen, that's it :)
Gimp_
ca juste coupe le array, et place dans les variables uniques.
Inazad
Gimp_, viens en pb
Gimp_
lietu: alright, sorry.
Wolfpaws
!+english
stormbot
##PHP is an English only channel. If you need support in some other language, please try elsewhere.
jiggster
quiet now :p
Wolfpaws
(Action) brings in a boom box
Hey! The music isn't THAT bad :(
stephelton
lol
Touqen
anyone want to send me $100?
Wolfpaws
Touqen: Want to send me application?
I mean homework? :3
Jymmm
Touqen what's my ROI ?
Touqen
100%
You get back what you invested.
kamoricks
Anyone need code? Doing every language concievable.
Wolfpaws
(Action) blinks
GwaiLo
finally, someone who can do my ocaml coding...
stephelton
Wolfpaws, are you learing php in school?
Wolfpaws
stephelton: Who said anything about school?
kamoricks
Okay, swap that to Lua, Python, C, C++, Java, PHP, Perl, and Bash.
Jymmm
Touqen screw that... MINIMUM > 500%
kamoricks
And... possibly lisp. Depends on how hard the lisp is.
Touqen
gah
stephelton
Wolfpaws, you mentioned application and then corrected yourself "homework"
Wolfpaws
Yay! Programming in Bash!
GwaiLo
bash is funj
-j
ksh is cool, too
Touqen
like a root canal
Wolfpaws
stephelton: Tat's not necessarily connected to school...
kamoricks
The... korn shell?
hfern
/msg php-bot guidelines
kamoricks
Wolfpaws: Ehm yes it is.
Wolfpaws
no, /msg stormbot guidelines... Check /topic
Jymmm
hfern: /msg stormbot guidelines
Wolfpaws
kamoricks: no it isn't... Y can get "homework" at work as well...
hfern
/msg stormbot guidelines
stephelton
Wolfpaws, well thats why i asked
Wolfpaws
*You
hfern: ...
I'm thinking: "What the hell...?"
tmpvar
can anyone guide me in finding some code to find the beginning of the week by a timestamp?
Touqen
get the day of week indicated by the timestamp and then subtract that many days from the timestamp
and whammo, you've got the start of the week
tmpvar
ah, ty much
prophile
while ( date ( "w", $timestamp ) != 0 ) $timestamp--;
that'd take bloody ages
but it would work
tmpvar
haha, thanks
kamoricks
prophile: Why? That's only 7 executions.
prophile
kamoricks: no, it's not. timestamps represent seconds.
kamoricks
...Oh god no then.
$day = 60*24; while(date("w", $timestamp)!=0) $timestamp -= $day;
ZEUGMA
hello
i have a problem when downloading big files using ftp functions
i have 1gb VOB files that i want to download from the webbrowser using php
_nero_
kamoricks, I'd do $day=60*60*24; ;)
ZEUGMA
i click the link to the file, it contacts the server and stays waiting forever
is there some setting i could tweak in php.ini to fix this?
Touqen
1 day = 86400 seconds
spare the unnecessary multiplication
jiggster
drop the damn epoch!
:P
tmpvar
$timestamp-(date("w",$timestamp)*(3600*24));
thanks guys!
_nero_
Touqen, true.. but if you must do the multiplication, it helps to do the proper multiplication.
Xyphoid
leap seconds always make me nervous when going from timestamps to larger intervals
radam
zeugma - are you passing the file through php for the download?
ZEUGMA
i have 1gb VOB files that i want to download from the webbrowser using php
i click the link to the file, it contacts the server and stays waiting forever
is there some setting i could tweak in php.ini to fix this?
Crapple
Is there any way to make PHP do multiple things at once (i.e. thread) or speed up the rate at which it does things?
MarkR42
Crapple: You can't start new threads within a web context
Crapple
its a CLI script that verifies 95,000 URL links people have submitted
looks for codes other than 200
MarkR42
I see
in which case some kind of parallelisation would be recommended
Crapple
and deletes them from mysql if it gets one.
Yeah its been running for hours and its on record 5000
SirFunk
hey, what is wrong with this line: $convertCommand = "convert -size $GLOBALS['cfg']['Image']['ThumbWidth']x$GLOBALS['cfg']['Image']['ThumbHeight'] '$origPath'" i'm getting a unexpected T_ENCAPSED_AND_WHITESPACE error
Crapple
MarkR42: any idea how I could do that?
maybe seperate the sql query?
MarkR42
Crapple: It is possible to run several CLI processes at once. You can either use fork (possibly error prone), or start them from the shell or via system() etc, using the proper shell job control operators
Crapple
into like 5 different blocks or something and run all 5 blocks simultaneously
like 0-15000; 15000-30000; 30000-45000, etc?
_nero_
Crapple, if you are going to run multiple CLI processes, have a data file that holds the last record number being acted on..
before each record, the script checks the number, grabs the next one, and records it..
but you'd need to do some sort of lock.. that might be a PITA..
Crapple
maybe I should just decrease how long cURL will wait
MarkR42
Anyway, if you make a PHP control process which decides what to do, then invokes a number of copies of the workers, which individually only do what they're told
reaVer
SirFunk: try: "convert -size " . $GLOBALS['cfg']['Image']['ThumbWidth'] . "x" . $GLOBALS['cfg']['Image']['ThumbHeight'] . " " . $origPath
Crapple
if the pages load slow it sits there _forever_
SirFunk
reaVer: yeah, that works.. i was trying to cut down on all the .'s and stuff
reaVer
well, afaik you can have arrays in an echo without it whining about it
Crapple
MarkR42: so write a function called checkurl($start, $end) { and have the control process send starts and ends to each worker process?
reaVer
*can't
MarkR42
A better alternative might be to use some external process such as "linkchecker", and simply supply the 100k URLs as a datafile into it, then parse the results?
SirFunk
ack.. wait i just changed it back and it's still whining!
Crapple
MarkR42: I was thinking maybe doing a mysql_num_rows and then dividing it by 25, and just having that script call another script 25 times with the start/stops for what IDs each child is supposed to check
reaVer
SirFunk: check if all the ; are there:P
Maquiavelo
Hey guys, what's wrong with this command? INSERT INTO datos_cuenta (email, cedula, password) values ('$_REQUEST[nombre]', '$_REQUEST[apellido]', '$_REQUEST[password]') ? I'm getting a Error: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '0' at line 1 when I'm trying to pass it through a mysql_query in PHP
ZEUGMA
i have 1gb VOB files that i want to download from the webbrowser using php
i click the link to the file, it contacts the server and stays waiting forever
is there some setting i could tweak in php.ini to fix this?
MarkR42
Crapple: Yes, but it would be better to just do a select count(*) rather than loading a redundant result set of 100k rows into memory
« 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 34 next »