Stránka: 1 z 1
| [ Príspevkov: 13 ] | |
Autor | Správa |
---|
Registrovaný: 11.01.09 Prihlásený: 17.07.22 Príspevky: 371 Témy: 181 | 181 Bydlisko: BB |
http://sk2.php.net/str_replace ...
ako by som mohol replacnut tento text :
toto zmenit
Kód: if ( $this->settings['reg_show'] and $this->settings['reg_name'] ) { $copyright .= "<br />AA: ". $this->settings['reg_name']; } za toto Kód: $copyright .= "<br />AA: ";
Dakujem
|
|
Registrovaný: 21.02.07 Prihlásený: 21.02.10 Príspevky: 3984 Témy: 96 | 96 |
Buď sa pýtaš absolútnu banalinu alebo nerozumiem ...
|
|
Registrovaný: 11.01.09 Prihlásený: 17.07.22 Príspevky: 371 Témy: 181 | 181 Bydlisko: BB |
Kód: if ( $this->settings['reg_show'] and $this->settings['reg_name'] ) { $copyright .= "<br />AA: ". $this->settings['reg_name']; }
zmenit na toto Kód: $copyright .= "<br />AA: ". $this->settings['reg_name'];
pomocou strreplace
chcem to zmenit v inom subore ...
|
|
Registrovaný: 21.02.07 Prihlásený: 21.02.10 Príspevky: 3984 Témy: 96 | 96 |
Stále dávaš málo údajov. Podľa toho čo hovoríš stačí tých pár znakov zmazať ...
|
|
Registrovaný: 11.01.09 Prihlásený: 17.07.22 Príspevky: 371 Témy: 181 | 181 Bydlisko: BB |
Ano ale ja to chcem nejako vyriesit cez PHP
Ten druhy text sa nahradi za prvy ![:)](https://www.pcforum.sk/images/smilies/smile02.gif)
|
|
Registrovaný: 09.07.08 Prihlásený: 17.01.15 Príspevky: 1585 Témy: 96 | 96 |
Poď na to z druhej strany. Máš zle naformátovaný kód a potrebuješ ho naformátovať? Alebo aký účel to má spĺňať?
_________________ neříkejte, že něco nejde udělat, protože se vždycky najde nějaký blbec, co neví, že to nejde – a udělá to! |
|
Registrovaný: 11.01.09 Prihlásený: 17.07.22 Príspevky: 371 Témy: 181 | 181 Bydlisko: BB |
Mam text v subore napr. mojtext.php no a chcem ho zmenit pomocou nejakeho skriptu ![:)](https://www.pcforum.sk/images/smilies/smile02.gif) nie zmenit nazov suboru ale to co v nom je ![:)](https://www.pcforum.sk/images/smilies/smile02.gif)
|
|
Registrovaný: 09.07.08 Prihlásený: 17.01.15 Príspevky: 1585 Témy: 96 | 96 |
Naozaj ho chceš zmeniť pomocou skriptu alebo by ti stačil normálny nástroj, ktorý to zvládne?
_________________ neříkejte, že něco nejde udělat, protože se vždycky najde nějaký blbec, co neví, že to nejde – a udělá to! |
|
Registrovaný: 11.01.09 Prihlásený: 17.07.22 Príspevky: 371 Témy: 181 | 181 Bydlisko: BB |
potrebujem to pomocou php ![:(](https://www.pcforum.sk/images/smilies/smile18.gif)
|
|
Registrovaný: 30.05.06 Prihlásený: 08.10.14 Príspevky: 1756 Témy: 35 | 35 Bydlisko: BA - WESTSIDE |
A kde je teda problém? Kód: $stare = " if ( \$this->settings['reg_show'] and \$this->settings['reg_name'] ) { \$copyright .= \"<br />AA: \". \$this->settings['reg_name']; }"; $nove = "\$copyright .= \"<br />AA: \";"; strreplace($stare, $nove, $text); Samozrejme, premennú $text si najprv musíš naplniť textom, v ktorom toto všetko chceš meniť. Predpokladám, že je to súbor, tak no napr. načítaj do reťazca cez file_get_contents a potom zapíš cez file_put_contents.
_________________
A. S. Tanenbaum píše: The terms LF, MF, and HF refer to low, medium, and high frequency, respectively. Clearly, when the names were assigned, nobody expected to go above 10 MHz, so the higher bands were later named the Very, Ultra, Super, Extremely, and Tremendously High Frequency bands. Beyond that there are no names, but Incredibly, Astonishingly, and Prodigiously high frequency (IHF, AHF, and PHF) would sound nice. |
|
Registrovaný: 11.01.09 Prihlásený: 17.07.22 Príspevky: 371 Témy: 181 | 181 Bydlisko: BB |
Call to undefined function strreplace
|
|
Registrovaný: 21.02.07 Prihlásený: 21.02.10 Príspevky: 3984 Témy: 96 | 96 |
oprav si posledný riadok na:
Kód: $text = str_replace($stare, $nove, $text);
|
|
Registrovaný: 30.05.06 Prihlásený: 08.10.14 Príspevky: 1756 Témy: 35 | 35 Bydlisko: BA - WESTSIDE |
A možno tam bude trochu srandovať aj escapovanie, ale veď s tým sa už nejak pohráš. ![:)](https://www.pcforum.sk/images/smilies/smile02.gif)
_________________
A. S. Tanenbaum píše: The terms LF, MF, and HF refer to low, medium, and high frequency, respectively. Clearly, when the names were assigned, nobody expected to go above 10 MHz, so the higher bands were later named the Very, Ultra, Super, Extremely, and Tremendously High Frequency bands. Beyond that there are no names, but Incredibly, Astonishingly, and Prodigiously high frequency (IHF, AHF, and PHF) would sound nice. |
|
Stránka: 1 z 1
| [ Príspevkov: 13 ] | |
Podobné témy | Témy | Odpovede | Zobrazenia | Posledný príspevok |
---|
![V tomto fóre nie sú ďalšie neprečítané témy. V tomto fóre nie sú ďalšie neprečítané témy.](https://www.pcforum.sk/styles/white/imageset/topic_read.gif) | v PHP, ASP | 4 | 860 | 01.08.2009 21:26 Tominator | ![V tomto fóre nie sú ďalšie neprečítané témy. V tomto fóre nie sú ďalšie neprečítané témy.](https://www.pcforum.sk/styles/white/imageset/topic_read.gif) | v Ostatné | 5 | 425 | 02.07.2021 14:53 MTK | ![V tomto fóre nie sú ďalšie neprečítané témy. V tomto fóre nie sú ďalšie neprečítané témy.](https://www.pcforum.sk/styles/white/imageset/topic_read.gif) | v JavaScript, VBScript, Ajax | 5 | 519 | 28.05.2012 13:49 xxx9955 | ![V tomto fóre nie sú ďalšie neprečítané témy. V tomto fóre nie sú ďalšie neprečítané témy.](https://www.pcforum.sk/styles/white/imageset/topic_read.gif) | v PHP, ASP | 4 | 692 | 13.04.2008 19:31 Ded'leg | ![V tomto fóre nie sú ďalšie neprečítané témy. V tomto fóre nie sú ďalšie neprečítané témy.](https://www.pcforum.sk/styles/white/imageset/topic_read.gif) | v JavaScript, VBScript, Ajax | 2 | 508 | 28.03.2009 12:43 Frees | ![V tomto fóre nie sú ďalšie neprečítané témy. V tomto fóre nie sú ďalšie neprečítané témy.](https://www.pcforum.sk/styles/white/imageset/topic_read_hot.gif) | v JavaScript, VBScript, Ajax | 11 | 769 | 22.03.2011 14:50 camo | ![V tomto fóre nie sú ďalšie neprečítané témy. V tomto fóre nie sú ďalšie neprečítané témy.](https://www.pcforum.sk/styles/white/imageset/topic_read.gif) | v Operačné systémy Microsoft | 5 | 887 | 26.04.2008 6:20 mig07 | ![V tomto fóre nie sú ďalšie neprečítané témy. V tomto fóre nie sú ďalšie neprečítané témy.](https://www.pcforum.sk/styles/white/imageset/topic_read.gif) | v Ostatné | 1 | 548 | 13.06.2011 19:03 Ďuri | ![V tomto fóre nie sú ďalšie neprečítané témy. V tomto fóre nie sú ďalšie neprečítané témy.](https://www.pcforum.sk/styles/white/imageset/topic_read.gif) | v PHP, ASP | 1 | 754 | 21.01.2009 14:29 stenley | ![V tomto fóre nie sú ďalšie neprečítané témy. V tomto fóre nie sú ďalšie neprečítané témy.](https://www.pcforum.sk/styles/white/imageset/topic_read.gif) | v Monitory, televízory a projektory | 8 | 733 | 29.06.2009 16:15 vazovski | ![V tomto fóre nie sú ďalšie neprečítané témy. V tomto fóre nie sú ďalšie neprečítané témy.](https://www.pcforum.sk/styles/white/imageset/topic_read_hot.gif) | v HTML, XHTML, XML, CSS | 18 | 1533 | 11.08.2007 18:19 Flety | ![V tomto fóre nie sú ďalšie neprečítané témy. V tomto fóre nie sú ďalšie neprečítané témy.](https://www.pcforum.sk/styles/white/imageset/topic_read.gif) | v JavaScript, VBScript, Ajax | 0 | 752 | 24.07.2007 21:45 kajbo | ![V tomto fóre nie sú ďalšie neprečítané témy. V tomto fóre nie sú ďalšie neprečítané témy.](https://www.pcforum.sk/styles/white/imageset/topic_read.gif) | v JavaScript, VBScript, Ajax | 4 | 587 | 27.11.2009 20:35 DjLefo | ![V tomto fóre nie sú ďalšie neprečítané témy. V tomto fóre nie sú ďalšie neprečítané témy.](https://www.pcforum.sk/styles/white/imageset/topic_read.gif) | v HTML, XHTML, XML, CSS | 4 | 2121 | 15.11.2009 21:01 Gryphon | ![V tomto fóre nie sú ďalšie neprečítané témy. V tomto fóre nie sú ďalšie neprečítané témy.](https://www.pcforum.sk/styles/white/imageset/topic_read.gif) | v Delphi, Visual Basic | 1 | 1641 | 01.09.2009 14:48 Wpegb | ![V tomto fóre nie sú ďalšie neprečítané témy. V tomto fóre nie sú ďalšie neprečítané témy.](https://www.pcforum.sk/styles/white/imageset/topic_read_hot.gif) | v HTML, XHTML, XML, CSS | 14 | 1260 | 09.08.2009 18:42 shaggy |
|