Welcome Guest, Not a member yet? Register   Sign In
count_all_results returns a string?
#7

[eluser]TheFuzzy0ne[/eluser]
Perhaps CodeIgniter should, but it all comes at the cost of speed. I've never had a problem making comparisons or doing math, and if I did, I'd cast it.

Code:
$str = "1";
$num = 1;

echo "\n";

echo '($num == $str): ';
echo (($num == $str) ? 'Yes' : 'No');
echo "\n";

echo '(($num + $str) == 2): ';
echo ((($num + $str) == 2) ? 'Yes' : 'No') . "\n";
echo "\n";

PHP is a loosely typed language, and that's what makes it so great. I think that helps you write less code. After all, PHP scripts are parsed and compiled at run time, they are not precompiled like Java or C#/C++ applications. Also, PHP is meant to be simple, and easy to learn and use. IMHO this accounts for a lot of PHP's popularity over other server-side scripting languages. The other major part is that it's free.


Messages In This Thread
count_all_results returns a string? - by El Forum - 04-03-2009, 08:51 AM
count_all_results returns a string? - by El Forum - 04-03-2009, 08:54 AM
count_all_results returns a string? - by El Forum - 04-03-2009, 09:03 AM
count_all_results returns a string? - by El Forum - 04-03-2009, 09:45 AM
count_all_results returns a string? - by El Forum - 04-03-2009, 10:49 AM
count_all_results returns a string? - by El Forum - 04-03-2009, 01:25 PM
count_all_results returns a string? - by El Forum - 04-03-2009, 01:54 PM
count_all_results returns a string? - by El Forum - 04-04-2009, 09:57 AM
count_all_results returns a string? - by El Forum - 04-05-2009, 04:09 AM
count_all_results returns a string? - by El Forum - 04-05-2009, 04:30 AM
count_all_results returns a string? - by El Forum - 04-05-2009, 04:56 AM
count_all_results returns a string? - by El Forum - 04-05-2009, 06:06 AM
count_all_results returns a string? - by El Forum - 04-08-2009, 10:50 AM
count_all_results returns a string? - by El Forum - 04-08-2009, 11:04 AM



Theme © iAndrew 2016 - Forum software by © MyBB