From c5d0cf87b205aedac44ae77175c26be70d1e119b Mon Sep 17 00:00:00 2001 From: jgiese328 Date: Tue, 17 May 2016 18:54:34 -0400 Subject: [PATCH 1/4] Add files via upload Difficult to follow instructions, think I got it for this challenge though. --- src/data_types.php | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 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..19b44f4 --- /dev/null +++ b/src/data_types.php @@ -0,0 +1,38 @@ + From 559c230fa75209739e467d6f62301c07997e945e Mon Sep 17 00:00:00 2001 From: jgiese328 Date: Tue, 17 May 2016 18:59:39 -0400 Subject: [PATCH 2/4] Update data_types.php May not have liked missing brackets. --- src/data_types.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/data_types.php b/src/data_types.php index 19b44f4..0f11ce0 100644 --- a/src/data_types.php +++ b/src/data_types.php @@ -17,7 +17,9 @@ function convert_to_float($value) { } function convert_to_string($value) { if(is_array($value)) + { $value = implode(',',$value); + } return strval($value); } function convert_to_bool($value) { @@ -27,9 +29,12 @@ function convert_to_array($array) { $result = explode(',',$array); if(is_array($result)) + { return $result; - else + } + else { return array(); + } } function convert_to_null($value) { return NULL; From cbd2644a94fbecf61825e5eb4fcdd5576664af15 Mon Sep 17 00:00:00 2001 From: jgiese328 Date: Tue, 17 May 2016 19:14:22 -0400 Subject: [PATCH 3/4] Update data_types.php Quick fixes, honestly if this doesn't work, to hell with it. --- src/data_types.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/data_types.php b/src/data_types.php index 0f11ce0..c0b8d06 100644 --- a/src/data_types.php +++ b/src/data_types.php @@ -18,16 +18,16 @@ function convert_to_float($value) { function convert_to_string($value) { if(is_array($value)) { - $value = implode(',',$value); + $value = implode(', ',$value); } return strval($value); } function convert_to_bool($value) { return boolval($value); } -function convert_to_array($array) { - $result = explode(',',$array); +function convert_to_array($value) { + $result = array($value) if(is_array($result)) { return $result; From 1c7a74a26133bf39772cb318b8e6db5e739376a4 Mon Sep 17 00:00:00 2001 From: jgiese328 Date: Tue, 17 May 2016 19:19:45 -0400 Subject: [PATCH 4/4] Last try on this.... Missed semicolon. --- src/data_types.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/data_types.php b/src/data_types.php index c0b8d06..c9e8aeb 100644 --- a/src/data_types.php +++ b/src/data_types.php @@ -27,7 +27,7 @@ function convert_to_bool($value) { } function convert_to_array($value) { - $result = array($value) + $result = array($value); if(is_array($result)) { return $result;