PHP equivalent to JavaScript's string split method

Posted by m4k00 on Stack Overflow See other posts from Stack Overflow or by m4k00
Published on 2011-02-18T23:09:04Z Indexed on 2011/02/18 23:25 UTC
Read the original article Hit count: 258

Filed under:
|

I'm working with this on JavaScript:

<script type="text/javascript">
    var sURL = "http://itunes.apple.com/us/app/accenture-application-for/id415321306?uo=2&mt=8&uo=2";
    splitURL = sURL.split('/');
    var appID = splitURL[splitURL.length - 1].match(/[0-9]*[0-9]/)[0];
    document.write('<br /><strong>Link Lookup:</strong> <a href="http://ax.itunes.apple.com/WebObjects/MZStoreServices.woa/wa/wsLookup?id=' + appID + '&country=es" >Lookup</a><br />');
</script>

This script takes the numeric ID and gives me 415321306.

So my question is how can I do the same thing but using PHP.

Best regards.

© Stack Overflow or respective owner

Related posts about php

Related posts about JavaScript