So I'm getting a section of the url with php. This section may or may not have trailing '?' values. So for example : I'm exploding the url : stackoverflow.com/questions and I want to get questions so i do something like explode ('/',$url)
. Pretend in this example the url might be as follows : stackoverflow.com/questions?query. I don't want that ending 'query' so I do explode ('?',$questionurl[no.])
. However how does explode handle when the string doesn't contain the delimiter? Does it just return the string as it was or does it return false?
I've read through the php document and looked though questions in stack but can't quite seem to find this exact scenario.
I would be able to test this myself however the environment I'm working in is set up to work with drupal. As such it would require quite alot of messing around to be able to test one simple query, I figured it would more useful for all and future parties, here.
limit
argument.... exactly as described in the [documentation(php.net/manual/en/function.explode.php)... "If delimiter contains a value that is not contained in string and a negative limit is used, then an empty array will be returned, otherwise an array containing string will be returned." – Poultertest.php
file anywhere on your server, put code inside<?php ?>
tags and it will work. It has nothing to do with Drupal. – PhotophobiaNOTICE
could be issued by PHP (only if you are unwrapping the results) as seen here (although technically in PHP's world Notice is different from error) – Lise