Jump to content

Archived

This topic is now archived and is closed to further replies.

Liquid Fire

Fully Understanding MVC Concept?

Recommended Posts

You could just as easily use explode to place the variables into local scope.

 

but you they initialize the vars ?

where they make something like this

 

$name = $array['name']; ?

 

explode returns an array :s

Share this post


Link to post
Share on other sites

i think thorpe meant 'extract() which takes an associative array and creates variables of same name as key in the local scope.

 

<?php
$myarray = array(
   'dog' => 'woof',
   'cat' => 'miaw'
);
extract($myarray);

echo $dog; // outputs 'woof'
echo $cat; // outputs 'miaw'
?>

Share this post


Link to post
Share on other sites

Sorry, indeed I did meen extract. Having a hard time posting between actual work tonight :)

Share this post


Link to post
Share on other sites

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.