From 10a9fa46eeb5de94f8218615198628b4a7a9248b Mon Sep 17 00:00:00 2001 From: Mitch Sharber Date: Thu, 19 May 2016 19:42:56 -0400 Subject: [PATCH 1/3] Finished code challenge...maybe? --- src/data_types.php | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 src/data_types.php diff --git a/src/data_types.php b/src/data_types.php new file mode 100644 index 0000000..ebd82f8 --- /dev/null +++ b/src/data_types.php @@ -0,0 +1,28 @@ + Date: Thu, 19 May 2016 19:44:31 -0400 Subject: [PATCH 2/3] Finished code challenge now, maybe? --- src/data_types.php | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/data_types.php b/src/data_types.php index ebd82f8..2f1aff3 100644 --- a/src/data_types.php +++ b/src/data_types.php @@ -23,6 +23,3 @@ function convert_to_array($input) { function convert_to_null($input) { return null; } - -$trial = convert_to_null(1); -var_dump($trial); \ No newline at end of file From 5a64ecf14dcdaaabe408b0fd056cc1d1b928d608 Mon Sep 17 00:00:00 2001 From: Mitch Sharber Date: Thu, 2 Jun 2016 19:07:57 -0400 Subject: [PATCH 3/3] Second try at code challenge --- src/data_types.php | 8 ++++++-- src/index.php | 0 2 files changed, 6 insertions(+), 2 deletions(-) create mode 100644 src/index.php diff --git a/src/data_types.php b/src/data_types.php index 2f1aff3..56d3611 100644 --- a/src/data_types.php +++ b/src/data_types.php @@ -9,7 +9,11 @@ function convert_to_float($input) { } function convert_to_string($input) { - return strval($input); + if (gettype($input) === 'array') { + return implode(", ", $input); + } else { + return strval($input); + } } function convert_to_bool($input) { @@ -22,4 +26,4 @@ function convert_to_array($input) { function convert_to_null($input) { return null; -} +} \ No newline at end of file diff --git a/src/index.php b/src/index.php new file mode 100644 index 0000000..e69de29