<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[we developers forum]]></title>
	<link rel="self" href="http://forum.wedevs.com/feed/atom/forum/12/"/>
	<updated>2009-11-09T19:02:40Z</updated>
	<generator>PunBB</generator>
	<id>http://forum.wedevs.com/</id>
		<entry>
			<title type="html"><![CDATA[What filters should apply before inseritng data to mysql]]></title>
			<link rel="alternate" href="http://forum.wedevs.com/topic/34/what-filters-should-apply-before-inseritng-data-to-mysql/new/posts/"/>
			<summary type="html"><![CDATA[What is the possible filters before storing data to mysql?

i know only
[code]htmlspecialchars()
addslashesh()[/code]
is their any other filters/functions to apply?]]></summary>
			<author>
				<name><![CDATA[arobd]]></name>
				<uri>http://forum.wedevs.com/user/2/</uri>
			</author>
			<updated>2009-11-09T19:02:40Z</updated>
			<id>http://forum.wedevs.com/topic/34/what-filters-should-apply-before-inseritng-data-to-mysql/new/posts/</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[PHP Frameworks]]></title>
			<link rel="alternate" href="http://forum.wedevs.com/topic/35/php-frameworks/new/posts/"/>
			<summary type="html"><![CDATA[Here you can find a simple step by step comparison of three popular PHP frameworks: Zend, Symfony and CakePHP.

[url=http://www.ibm.com/developerworks/views/opensource/libraryview.jsp?search_by=php+frameworks,&ca=dgr-lnxw07PHP-Frameworks&S_TACT=105AGX59&S_CMP=grsitelnxw07]IBM DeveloperWorks[/url]]]></summary>
			<author>
				<name><![CDATA[Tareq]]></name>
				<uri>http://forum.wedevs.com/user/42/</uri>
			</author>
			<updated>2009-03-18T01:22:20Z</updated>
			<id>http://forum.wedevs.com/topic/35/php-frameworks/new/posts/</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Formatting date, time and time zone with php]]></title>
			<link rel="alternate" href="http://forum.wedevs.com/topic/27/formatting-date-time-and-time-zone-with-php/new/posts/"/>
			<summary type="html"><![CDATA[Formatting date, time and time zone with php is a very easy task. You may have a date
string in your database like (March 7, 2009, 5:16 pm), (03.10.01), (Sat Mar 10 15:16:08 MST 2001)
or as a timestamp like (1232886599) or something else. But you want to show this time in other
formats.
As example, you may have (March 7, 2009, 5:16 pm), but you want show this as 10-03-2001. So how
will you do this task? The answer is simple. Following code shows that
[code]<?php
$date = 'March 7, 2009, 5:16 pm'; //date from your database
//make it as time stamp
$date = strtotime($date); //makes the date as timestamp
$date = date('d-m-Y',$date); // show as (07-03-2009)
echo $date;
?>[/code]
You can make any kind of formate with the timestamp. So, at first you need to convert the date
in timestamp. 

Another Thing is to show a time in your time zone. How to do this?
[code]<?php
$date = $some_gmt_date; //date from your database
//make it as time stamp
$date = strtotime($date); //makes the date as timestamp
date_default_timezone_set('Asia/Dhaka'); //this is for +6 with gmt
$date = date('d-m-Y',$date); // show as (07-03-2009)
echo $date;
?>[/code]
That was preety easy
[url=http://tareq.wedevs.com/2009/03/php/formatting-date-time-and-time-zone-with-php/]from my blog[/url]]]></summary>
			<author>
				<name><![CDATA[Tareq]]></name>
				<uri>http://forum.wedevs.com/user/2/</uri>
			</author>
			<updated>2009-03-07T15:17:44Z</updated>
			<id>http://forum.wedevs.com/topic/27/formatting-date-time-and-time-zone-with-php/new/posts/</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[How to fetch unicode character from MySQL?]]></title>
			<link rel="alternate" href="http://forum.wedevs.com/topic/19/how-to-fetch-unicode-character-from-mysql/new/posts/"/>
			<summary type="html"><![CDATA[Some days ago i tried to fetch some posts from a punBB database. the value was in bangla. when i fetched them, the character was like ???? sign. Then i used htmlspecialchars() and also htmlentities() function. But the result was same. So how to fetch them properly? i need help please]]></summary>
			<author>
				<name><![CDATA[Tareq]]></name>
				<uri>http://forum.wedevs.com/user/2/</uri>
			</author>
			<updated>2009-03-01T07:03:25Z</updated>
			<id>http://forum.wedevs.com/topic/19/how-to-fetch-unicode-character-from-mysql/new/posts/</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Easy to make mistake]]></title>
			<link rel="alternate" href="http://forum.wedevs.com/topic/16/easy-to-make-mistake/new/posts/"/>
			<summary type="html"><![CDATA[hellow…I am trying to post a very simple Example of php variabe assigning..Its easy to make mistake when we assign values.Run the php code:

[code]
<?php

$a=0;

$b;

if ($a==$b) print(”values are same<br>”);

else print(”Variables are different<br>”);

?>
[/code]



output: values are same.

It means the value of $b is 0.

yaa….thats right.when we declare a php variabe Its initial value is 0 in number format.In strig format it is an empty string…its different in C++.

Just try to edit the code like folowing:

[code]
<?php

$a;

$b;

if ($a==$b) print(”values are same<br>”);

else print(”Variables are different<br>”);

?>
[/code]

output is same coz both of these variables values are empty string or NULL..

we can print the value of $b.

printf(”%f”,$b);   //result is 0.0000…//

so be aware of using these types of variable assignment……..I think It will help you…..:)]]></summary>
			<author>
				<name><![CDATA[Tareq]]></name>
				<email><![CDATA[galib_setu@yahoo.com]]></email>
				<uri>http://forum.wedevs.com/user/7/</uri>
			</author>
			<updated>2009-01-04T15:36:43Z</updated>
			<id>http://forum.wedevs.com/topic/16/easy-to-make-mistake/new/posts/</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Dnt Use floating point numbers as boolean]]></title>
			<link rel="alternate" href="http://forum.wedevs.com/topic/17/dnt-use-floating-point-numbers-as-boolean/new/posts/"/>
			<summary type="html"><![CDATA[PHP provides a couple of constants especially for use as Booleans: TRUE and FALSE, which
can be used like so:
[code]
if (TRUE)
print(“This will always print<BR>”);
else
print(“This will never print<BR>”);
[/code]

Here are the rules for determine the “truth” of any value not already of the Boolean type:
** If the value is a number, it is false if exactly equal to zero and true otherwise.
** If the value is a string, it is false if the string is empty (has zero characters) or is the
string “0”, and is true otherwise.
** Values of type NULL are always false.
**If the value is a compound type (an array or an object), it is false if it contains no other
values, and it is true otherwise. For an object, containing a value means having a
member variable that has been assigned a value.
**Valid resources are true (although some functions that return resources when they are
successful will return FALSE when unsuccessful).

But dont use floating point  as boolean…..coz floating point number has some rounding errors…run the following code:
[code]

<?php

$floatbool = sqrt(2.0) * sqrt(2.0) - 2.0;
if ($floatbool)
print(“Floating-point Booleans are dangerous!<BR>”);
else{
print(“It worked … this time.<BR>”);}
print(“The actual value is $floatbool<BR>”);

?>
[/code]

The variable $floatbool is set to the result of subtracting two from the square of the square
root of two—the result of this calculation should be equal to zero, which means that
$floatbool is false. Instead, the browser output we get is:
Floating-point Booleans are dangerous!
The actual value is 4.4408920985006E-16.

The value of $floatbool is very close to 0.0, but it is nonzero and, therefore, unexpectedly
true. Integers are much safer in a Boolean role—as long as their arithmetic happens only with
other integers and stays within integral sizes, they should not be subject to rounding errors……]]></summary>
			<author>
				<name><![CDATA[Tareq]]></name>
				<email><![CDATA[galib_setu@yahoo.com]]></email>
				<uri>http://forum.wedevs.com/user/7/</uri>
			</author>
			<updated>2009-01-04T15:30:56Z</updated>
			<id>http://forum.wedevs.com/topic/17/dnt-use-floating-point-numbers-as-boolean/new/posts/</id>
		</entry>
</feed>
