Jump to content

Find First Alphanumeric Character


papaface

Recommended Posts

can try putting a couple functions together

 

<?php
$string = "Here! is some text, and numbers 12345, and symbols !£$%^&";

$new_string = preg_replace("/[^a-zA-Z0-9s]/", "", $string);
$first_alpha = substr($new_string,0,1);
echo $first_alpha;
?>

 

Ray

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.