I have a textarea form field where users will put URL\'s separated by a new line. Would it be possible to wrap each line from this textarea field with < li > tags?
So
Using a regular expression you can check for non-empty lines as part of your test:
$li_text = preg_replace('/^(.+)$/', '$1', $_POST['textarea']);
That way if the user has an extra new line at the end of their input (or anywhere inside) you won't get extra empty list items.