Yii Framework Forum: Output Tinybit as "rue" or "False" - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Output Tinybit as "rue" or "False" Format output value Rate Topic: -----

#1 User is offline   BSC 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 13
  • Joined: 30-November 10
  • Location:Portugal

Posted 03 December 2010 - 09:23 AM

Hi

Is there any way to output a Tinybit value (1 or 0) to a string "True" or "False" (or "Yes" and "No")?

Tks
BSC
0

#2 User is offline   rudenich 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 69
  • Joined: 30-April 10
  • Location:Ukraine-Kramatorsk

Posted 03 December 2010 - 10:43 AM

$value = 1;
echo ($value==1)?'True':'False';

0

#3 User is offline   BSC 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 13
  • Joined: 30-November 10
  • Location:Portugal

Posted 04 December 2010 - 10:40 AM

View Postrudenich, on 03 December 2010 - 10:43 AM, said:

$value = 1;
echo ($value==1)?'True':'False';



Thanks. Simple solution (I'm a rookie in PHP as well)

Do you think you can help me with the date format issue?

Tks
BSC
0

#4 User is offline   lucifurious 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 184
  • Joined: 15-March 09
  • Location:Atlanta, GA.

Posted 04 December 2010 - 02:15 PM

date('m/d/Y',strtotime($model->dateValue);
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users