TalkPHP
 
 
Account Login
Latest Articles
» The basic usage of PHPTAL, a XML/XHTML template library for PHP
» Vulnerable methods and the areas they are commonly trusted in.
» Simple way to protect a form from bot
» The Basics On: How Session Stealing Works
» How to keep your forms from double posting data
IRC Channel
IRC Speech Bubble Join the friendly bunch on IRC...
(#TalkPHP on Freenode)

...Also available via a web interface.

See this thread for information on the TalkPHP Free Hugs Initiative™. Subject to availability.
Associates
Associates
CSS Tutorials
Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old 09-08-2008, 08:50 AM   #1 (permalink)
The Contributor
 
Join Date: May 2008
Location: Iran
Posts: 53
Thanks: 33
Yoosha is on a distinguished road
Help StrVal($X) VS (String)$X

Hi,
What is dif. between StrVal($X) VS (String)$X?
Regards.
Send a message via Yahoo to Yoosha
Yoosha is offline  
Reply With Quote
Old 09-08-2008, 09:10 AM   #2 (permalink)
The Prestige
Advanced Programmer Top Contributor Good Samaritan 
 
sketchMedia's Avatar
 
Join Date: Oct 2007
Location: Manchester, UK
Posts: 854
Thanks: 32
sketchMedia is on a distinguished road
Default

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
__________________
mysql> SELECT * FROM `users` WHERE `users`.`clue` > 0;
Empty set (0.00 sec)
sketchMedia is offline  
Reply With Quote
The Following User Says Thank You to sketchMedia For This Useful Post:
Yoosha (09-08-2008)
Old 09-08-2008, 05:51 PM   #3 (permalink)
The Contributor
 
Join Date: May 2008
Location: Iran
Posts: 53
Thanks: 33
Yoosha is on a distinguished road
Default

Thanks SktchMedia, resolved ;).
Send a message via Yahoo to Yoosha
Yoosha is offline  
Reply With Quote
Old 09-08-2008, 06:13 PM   #4 (permalink)
The Prestige
Advanced Programmer Top Contributor Good Samaritan 
 
sketchMedia's Avatar
 
Join Date: Oct 2007
Location: Manchester, UK
Posts: 854
Thanks: 32
sketchMedia is on a distinguished road
Default

no probs m8
__________________
mysql> SELECT * FROM `users` WHERE `users`.`clue` > 0;
Empty set (0.00 sec)
sketchMedia is offline  
Reply With Quote
Old 09-08-2008, 07:54 PM   #5 (permalink)
Jim
The Addict
 
Jim's Avatar
 
Join Date: Nov 2007
Location: the Netherlands
Posts: 281
Thanks: 2
Jim is on a distinguished road
Default

Why would you like to cast a datatype in PHP?
__________________
Nunchaku! Who doesn't like martial arts? =)
Send a message via MSN to Jim Send a message via Skype™ to Jim
Jim is offline  
Reply With Quote
Old 09-09-2008, 11:48 AM   #6 (permalink)
The Frequenter
 
xenon's Avatar
 
Join Date: Dec 2007
Location: Bucharest, Romania
Posts: 438
Thanks: 3
xenon is on a distinguished road
Default

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.
__________________
I have optimistic thoughts, even though sometimes (if not always) life's a bitch.
xenon is offline  
Reply With Quote
Old 09-10-2008, 07:22 PM   #7 (permalink)
The Contributor
 
Join Date: May 2008
Location: Iran
Posts: 53
Thanks: 33
Yoosha is on a distinguished road
Default

Thanks to all. Resolved ;).
Send a message via Yahoo to Yoosha
Yoosha is offline  
Reply With Quote
Old 09-10-2008, 08:17 PM   #8 (permalink)
Moderateur
RegEx Guru PHP Guru Top Contributor Advanced Programmer 
 
Salathe's Avatar
 
Join Date: Apr 2007
Posts: 1,381
Thanks: 5
Salathe is on a distinguished road
Default

Quote:
Originally Posted by Jim View Post
Why would you like to cast a datatype in PHP?
Why would anyone use the strval function?

P.S. It's a rhetorical question folks.
Salathe is offline  
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


All times are GMT. The time now is 04:43 AM.

 
     

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Inactive Reminders By Icora Web Design