No the problem is I'm reading a file into an array and then need
to change any of the links in the file from relative links to absolute links
!
So that my lg_mode.gif gets the full server path in front of it
http://www.ltest.com/lg_mode.gif

and exactly the same with the other one but of course I don't won't

http://www.test.com//folder/name.gif

>
>  > I'm trying to find files in my array
>  > for example
>  > ="lg_imode.gif"
>  > and
>  > ="/db/imodeklein/edgar-IMODE-1-.gif"
> >
>  > I want to differentiate between the files with slash at the front and
ones
>  > without so that
>  > I can add a server path !
>  > but as usual I' m having problems with the correct regex
>
> what about something simple as:
>
> $str = "/db/skod.gif";
>
> if (strpos($str, "/") == 0) {
>    echo "Slash first";
> } else {
>   echo "Slash not first";
> }
>
> --
> Henrik Hansen
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to