Autor | Zpráva | ||
---|---|---|---|
hans Profil * |
#1 · Zasláno: 12. 4. 2006, 20:30:29
prosím o pomoc jak zamezit výpisu "Warning" při otevírání streamu $stream = fopen($url,'r');
pokud zadám neplatnou URL adresu jako parametr funkce by měla vrátit FALSE ?? veškeré testování jako if(!$stream) jde samozřejmě ošetřit ale provede se až poté co se to PHP pokusí otevřít |
||
Peca Profil |
#2 · Zasláno: 12. 4. 2006, 20:43:03
Nejlehčí je dát @ před fopen. ... = @fopen(...
|
||
*Čvachta* Profil * |
#3 · Zasláno: 12. 4. 2006, 20:45:52
fopen($url,'x'); nebo x+
|
||
hans Profil * |
#4 · Zasláno: 12. 4. 2006, 20:58:59
Peca:
no jo no, jak prosté :-) to mně blbce nenapadlo a já se tady s tím mořím, díky moc Čvachta: ten parametr x je co zač ?? manual na php.net o ničem takovém nepíše |
||
Peca Profil |
#5 · Zasláno: 12. 4. 2006, 21:21:21
Co to máš za manuál? :-)
http://cz2.php.net/fopen |
||
hans Profil * |
#6 · Zasláno: 12. 4. 2006, 21:47:27
já tam vidím 'r' 'w' nebo 'a' případně 'b' ale žádné 'x' ??
manuál je stejný - na tom odkazu tam nic nevidím :-) |
||
Tomik Profil |
#7 · Zasláno: 12. 4. 2006, 21:59:35
hans
Vážně? :) Já ho tam tedy vidím.. :) |
||
*Čvachta* Profil * |
#8 · Zasláno: 12. 4. 2006, 22:03:46
x
Create and open for writing only; place the file pointer at the beginning of the file. If the file already exists, the fopen() call will fail by returning FALSE and generating an error of level E_WARNING. If the file does not exist, attempt to create it. This is equivalent to specifying O_EXCL|O_CREAT flags for the underlying open(2) system call. This option is supported in PHP 4.3.2 and later, and only works for local files. x+ [i]Create and open for reading and writing; place the file pointer at the beginning of the file. If the file already exists, the fopen() call will fail by returning FALSE and generating an error of level E_WARNING. If the file does not exist, attempt to create it. This is equivalent to specifying O_EXCL|O_CREAT flags for the underlying open(2) system call. This option is supported in PHP 4.3.2 and later, and only works for local files./i] |
||
Hugo Profil |
#9 · Zasláno: 12. 4. 2006, 22:04:28
Pokud se nepletu, tak x nefunguje pro soubory na jiném serveru.
|
||
Tomik Profil |
#10 · Zasláno: 12. 4. 2006, 22:09:40
Hugo
and only works for local files. Ano, máš pravdu... |
||
Časová prodleva: 18 let
|
Toto téma je uzamčeno. Odpověď nelze zaslat.
0