Skip to content

Instantly share code, notes, and snippets.

@chrisamoore
Last active December 17, 2015 02:29
Show Gist options
  • Save chrisamoore/5535916 to your computer and use it in GitHub Desktop.
Save chrisamoore/5535916 to your computer and use it in GitHub Desktop.
Interpolated String Issue
<?php
// I want this to work but I don't want to split and rejoin for operators
if(strpos($data, '.') !== false){
$data = self::makePath($data);
// client->client_name
return self::$order->{$data};
}
// This Works
if(strpos($data, '.') !== false){
$a ='client';
$b = 'client_name';
return self::$order->{$a}->{$b};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment