Jump to content

String Removal


Skepsis

Recommended Posts

hello, i'm creating a blockular system for my project and ran into a problem,  i don't need to go much in depth since this is a simple issue.  i have an array with a value:

<?php ['file'] = 'articles.blocks.php' ?>

i need to get just articles, .blocks.php is not global so i cannot use preg_replace or str_replace, i need to get rid of the first period, the first word, second period, and extension removed, so basically i need to find the module name, .var.php is not necessary.  I am not sure how to go about this, any suggestions?

Link to comment
https://forums.phpfreaks.com/topic/222289-string-removal/
Share on other sites

that worked fantastic! thank you kindly for that and for the fast response.  I was looking into preg_match but that definitely wasn't need.  I've taken a bit to look over the two functions you've provided me with, but can't seem to grasp it too well.  could you tell me how i'd be able to get the word after the first period?

Link to comment
https://forums.phpfreaks.com/topic/222289-string-removal/#findComment-1149874
Share on other sites

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.