Jump to content

String Help!


pengu

Recommended Posts

Hi,

 

I'm trying to figure out how to get some numbers out of a string.

 

Example of strings

$string1 = "3-tech";
$string2 = "109-bobby";
$string3 = "4-Charlie1994";
$string4 = "55-Mr-Smith";

 

What I want to do is grab everything BEFORE the "-" and the first dash.

I'm having a brain meltdown atm and just can't figure it out, I know it's something simple.

Link to comment
https://forums.phpfreaks.com/topic/245948-string-help/
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.