omtay38 Posted August 15, 2008 Share Posted August 15, 2008 I'm tearing my hair out over this: <?php $string = "foo-bar"; $array = explode("-", $string); print_r($array); ?> Returns an empty page. (This started off as a more complex problem and I narrowed it down to this simple statement). I recently did a fresh install of php using entropy's package but my other code (using the explode function in several areas) seems to be working fine. Any thoughts? Link to comment https://forums.phpfreaks.com/topic/119781-baffling-explode-problem/ Share on other sites More sharing options...
trq Posted August 15, 2008 Share Posted August 15, 2008 If you had error_reporting and display_errors on you would see the error. This line.... $array = explode("-", $string; need be.... $array = explode("-", $string); Link to comment https://forums.phpfreaks.com/topic/119781-baffling-explode-problem/#findComment-617085 Share on other sites More sharing options...
omtay38 Posted August 15, 2008 Author Share Posted August 15, 2008 That was a typo on my part, the ")" was in the real code. (I fixed it right after I posted it). Still no luck. Link to comment https://forums.phpfreaks.com/topic/119781-baffling-explode-problem/#findComment-617087 Share on other sites More sharing options...
trq Posted August 15, 2008 Share Posted August 15, 2008 Well I'm afraid there is nothing wrong with that code. It works as expected here. Link to comment https://forums.phpfreaks.com/topic/119781-baffling-explode-problem/#findComment-617095 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.