Jump to content

[SOLVED] find the first 2 characters in a url


samoht

Recommended Posts

hello,

 

I know this is easy but I forgot the syntax for just getting the first 2 characters of string (url in my case). can anyone help me?

 

my url value will be numeric, 5 digits, but I only want the first two.

So if the url was: mysite.com/clinic/11501

 

I have already exploded the url path into an array so $path[0] = "clinic" and $path[1] = 11501

How do I get the first 2 characters of $path[1]??

 

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.