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
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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.