Jump to content

substr between parenthesis


brem13

Recommended Posts

- Line 1: The string to process.

- Line 2: strpos finds the location of the opening parenthesis and then 1 is added to get the position of the first digit you want.

- Line 3: strpos finds the location of the closing parenthesis.

- Line 4: substr selects the text you want, using line 2 as the start position (the first digit) and the difference between the start and the end as the length.

 

If you want more information, the PHP manual will explain the functions better than I could.

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.