PHP Questions Home | Register | Login
Categories
Arrays
Files
Forms
Creating PDFs
PHP Errors
Functions
Images
MySQL
Numbers
Others
Strings
Website

PHP Forums
Forums Index
MySQL Forum
PHP Forum
Flash/Actionscript
Javascript
Web design

More PHP
PHP Functions
Top Questions
Ask a Question
PHP Interview Questions
PHP Jobs
Ecommerce
IT Questions
Business Websites

Sponsors

sponsor ad
My Salary
PHP Developer Salary
Advertise Here

PHP Questions Forums : PHP Questions and Answers

Jump to Last Post

Php function in echo?

By: Hawgang [13-October-10 7:41AM]
1 posts
picture

Hi I have a special problem ... I have three values from database.
Value1 is 1 or 0
Value2 is again 1 or 0
Value3 is remaining time like (24 hours left, 23, ...)

There valies are saved in variables:
$value1
$value2
$value3

These values are changing from DB every load from webpage. I have these values also in echo""; in php function already like:
echo"text text text .................
"Value 1 is:" . $value1 . " and value 2 is:" . $value2 . ""
..................;

What I need is a function that says fifferent thing like
if (value1=0)
echo "Only text"
else
echo "Value 1 is:" . $value1 . " and value 2 is:" . $value2 . ""; - this to be in another echo function from first example so in my way it looks like this:

*Some function*
echo"if (value1=0)
echo "Only text"
else
echo "Value 1 is:" . $value1 . " and value 2 is:" . $value2 . """; // two echo closing - but it does not worky any help here please how to solve this? thank you :-)

Previous: Twitter And OAuth
Next:



Custom Search