Given the following code:
its returning an array such as:
I would prefer it if the returned array had size=3, with one single URL. Is this possible?
Thank you in advance!
PHP:
$regex = '/(http\:\/\/|https\:\/\/)([a-z0-9-\.\/\?\=\+_]*)/i';$text = preg_split($regex, $note, -1, PREG_SPLIT_DELIM_CAPTURE);
PHP:
array (size=4) 0 => string '...' (length=X) 1 => string 'http s://' (length=8) 2 => string 'duckduckgo.com/?q=how+much+wood+could+a+wood-chuck+chuck+if+a+wood-chuck+could+chuck+wood' (length=89) 3 => string '...' (length=X)
I would prefer it if the returned array had size=3, with one single URL. Is this possible?
Thank you in advance!