Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

What is "(string)" in php statement?

Posted on 2015-02-19
3
Medium Priority
?
53 Views
Last Modified: 2015-02-20
Can someone please explain / refer me to the php documentation regarding the meaning/use of "(string)" in the following:

		// Do not serialize the $hooks because they might contain non-serializeable objects
		$key = (string) $dsn_or_conn . serialize($config) . $log_level;

Open in new window

0
Comment
Question by:SAbboushi
3 Comments
 
LVL 41

Accepted Solution

by:
Kyle Abrahams earned 1000 total points
ID: 40620161
It's a cast (conversion) to make the $dsn_or_conn . serialize($config) . $log_level a string.
0
 
LVL 23

Assisted Solution

by:Michael Fowler
Michael Fowler earned 1000 total points
ID: 40620174
For more detail have a look at Type Casting in this link
http://php.net/manual/en/language.types.type-juggling.php
0
 

Author Closing Comment

by:SAbboushi
ID: 40621530
Thanks guys!
0

Featured Post

[Webinar] Cloud and Mobile-First Strategy

Maybe you’ve fully adopted the cloud since the beginning. Or maybe you started with on-prem resources but are pursuing a “cloud and mobile first” strategy. Getting to that end state has its challenges. Discover how to build out a 100% cloud and mobile IT strategy in this webinar.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Many old projects have bad code, but the budget doesn't exist to rewrite the codebase. You can update this code to be safer by introducing contemporary input validation, sanitation, and safer database queries.
It’s a season to be thankful, and we’re thankful for users like you who engage on site, solve technology problems, and network with others in the industry. What tech are we most thankful for? Keep reading.
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
The viewer will learn how to count occurrences of each item in an array.
Suggested Courses

879 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question