akiznin Posted June 20, 2009 Share Posted June 20, 2009 How can I make it so instead of deleting anything that starts with a number from 0-9, I want it to only show things that start with a number from 0-9, how could i do this? <?php $fn = "1.txt"; $file = file_get_contents($fn); $file = preg_replace('/[0-9]/','',$file); echo $file; ?> Link to comment https://forums.phpfreaks.com/topic/162999-not-delete-the-text-but-show-it/ Share on other sites More sharing options...
JasonLewis Posted June 20, 2009 Share Posted June 20, 2009 What about using preg_match instead, or replaying anything that isn't a number. Link to comment https://forums.phpfreaks.com/topic/162999-not-delete-the-text-but-show-it/#findComment-860106 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.