Jump to content

Rewriting a variable?


cahamilton

Recommended Posts

Hello again....quick question! How would I rewrite a variable, so that everything after a certain point in the text, is deleted?

 

Currently, Im trying to do something like this:

 

The Offspring – Long Way Home <<< Starting with this

The Offspring <<< End like this

 

So anything after the " – " I want to delete. I think it has something to do with preg_replace, but I cant quite seem to get my head around the actual function itself to rewrite it. Would anyone be able to explain it to me?

Link to comment
https://forums.phpfreaks.com/topic/159432-rewriting-a-variable/
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.