Skip to content

Instantly share code, notes, and snippets.

@klhall1987
Last active October 9, 2015 13:39
Show Gist options
  • Save klhall1987/8b138aacbc083c0f66b2 to your computer and use it in GitHub Desktop.
Save klhall1987/8b138aacbc083c0f66b2 to your computer and use it in GitHub Desktop.
Extract Example
<?php
//Describes phone
$brand = "HTC";
$model = "One M8";
$os = "Android";
//Sets each string to a key value pair in an array.
$phone = compact("brand", "model" , "os");
//returns: Array ( [brand] => HTC [model] => One M8 [os] => Android )
print_r($phone);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment