Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> funkcja w stringu
andreu2311
post
Post #1





Grupa: Zarejestrowani
Postów: 8
Pomógł: 0
Dołączył: 25.10.2008

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


Witam, mam pewien problem z dodaniem wartości zwracanej przez funkcję do stringu.
Otóż zgodnie z tym co jest opisane na php.net , napis echo powinien zwrócić wartość zwracaną
przez funkcje, niestety nic się nie wyświetla. Wie ktoś może dlaczego?

<?php
function getName()
{
$a = 'ddd';
return a;
}

$b = 'b';
echo "This is the value of the var named by the return value of getName(): {${getName()}}";


?>
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi
andreu2311
post
Post #2





Grupa: Zarejestrowani
Postów: 8
Pomógł: 0
Dołączył: 25.10.2008

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


czyli jak?, mi na tym głównie zależało, żeby to co funkcja zwraca dodać do stringa, funkcje sam zrobiłem. echo "This is the value of the var named by the return value of getName(): {${getName()}}";

Ten post edytował andreu2311 18.02.2009, 23:38:48
Go to the top of the page
+Quote Post

Posty w temacie


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

 



RSS Aktualny czas: 17.10.2025 - 06:38