Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> [php][mysql] define
Taifun
post
Post #1





Grupa: Zarejestrowani
Postów: 222
Pomógł: 2
Dołączył: 10.07.2007

Ostrzeżenie: (10%)
X----


Kod
define('DB_NAME', 'putyourdbnamehere');

mam taki kod i jak wyciągnąć tą stałą do zmiennej?
$DB_NAME będzie dobrze bo jeszcze nie bawiłem się w define.


--------------------
Go to the top of the page
+Quote Post
skowron-line
post
Post #2





Grupa: Zarejestrowani
Postów: 4 340
Pomógł: 542
Dołączył: 15.01.2006
Skąd: Olsztyn/Warszawa

Ostrzeżenie: (0%)
-----


  1. <?php
  2. define("CONSTANT", "Hello world.");
  3. echo CONSTANT; // outputs "Hello world."
  4. echo Constant; // outputs "Constant" and issues a notice.
  5.  
  6. define("GREETING", "Hello you.", true);
  7. echo GREETING; // outputs "Hello you."
  8. echo Greeting; // outputs "Hello you."
  9. ?>


wiec
  1. <?php
  2. $define = CONSTANT;
  3. ?>


--------------------
I'm so fast that last night I turned off the light switch in my hotel room and was in bed before the room was dark - Muhammad Ali.
Peg jeżeli chcesz uprawiać sex to dzieci muszą wyjść, a jeżeli chcesz żeby był dobry ty też musisz wyjść - Al Bundy.

QueryBuilder, Mootools.net, bbcradio1::MistaJam
http://www.phpbench.com/
Go to the top of the page
+Quote Post

Reply to this topicStart new topic
1 Użytkowników czyta ten temat (1 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 19.08.2025 - 05:31