TalkPHP

TalkPHP (http://www.talkphp.com/forums.php)
-   Absolute Beginners (http://www.talkphp.com/absolute-beginners/)
-   -   StrVal($X) VS (String)$X (http://www.talkphp.com/absolute-beginners/3333-strval-x-vs-string-x.html)

Yoosha 09-08-2008 08:50 AM

StrVal($X) VS (String)$X
 
Hi,
What is dif. between StrVal($X) VS (String)$X?
Regards.

sketchMedia 09-08-2008 09:10 AM

StrVal returns the string value of a variable. (string) is a type cast (or type juggle)

PHP: Type Juggling - Manual

Its all in the manual

Yoosha 09-08-2008 05:51 PM

Thanks SktchMedia, resolved ;).

sketchMedia 09-08-2008 06:13 PM

no probs m8

Jim 09-08-2008 07:54 PM

Why would you like to cast a datatype in PHP?

xenon 09-09-2008 11:48 AM

Also, using an explicit cast is faster than calling a function.

Just to have some fun, Jim. Why do you think? Because sometimes it's necessary.

Yoosha 09-10-2008 07:22 PM

Thanks to all. Resolved ;).

Salathe 09-10-2008 08:17 PM

Quote:

Originally Posted by Jim (Post 18282)
Why would you like to cast a datatype in PHP?

Why would anyone use the strval function? :-P

P.S. It's a rhetorical question folks.


All times are GMT. The time now is 06:47 PM.

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0