Get value from a line containting key value seperated by : value can contain :
<blockquote>
  <p><strong>Possible Duplicate:</strong><br>
  <a href="http://stackoverflow.com/questions/2813241/php-split-alternative">PHP split alternative?</a>  </p>
</blockquote>



<p>I am a beginner in php, 
Basically I am trying to extrat value from a line 
the line format is key:value </p>

<p>The value may possibly contain :</p>

<p>So I want to divide it into two parts such that I get right and left side of first occurance of :</p>

<p>There is a function I have written because this will execute per line of a file </p>

<pre><code>    /**
     * Returns value of the key if its available in line
     * example line 
     * somekey: someva:lue
     * @param type $line  pass full line
     * @param type $key pass the key
     * @return type  someva:lue
     */
    function extractValue($line, $key){
        $value = null;
        $value_array = split(":", $line);
        if(count($value_array)== 2)    
        {
            if($value_array[0] == $key)
               $value = $value_array[1];
        }
        return $value; 
    }
</code></pre>

<p>I just started coding it today in netbeans anf get the following warning that split is deprectaed etc</p>

<pre><code> Deprecated: Function split() is deprecated in C:\wamp\www\myprojects\PhpProject1\upload_log.php on line 92
</code></pre>

<p>I am not very familiar with php , could you suggest an alternate function ? basically I want the line into two parts key:value  want to get value given a line and key</p>

<p>Thanks for help,</p>
