Recent Posts

This Post Has Been Viewed 179 Times.

How to split a word or sentence delimited with slashes, commas or hyphens

Posted by admin | Posted in PHP, scripts | Posted on 29-06-2009

0

How to split a word or sentence delimited with slashes,commas, dots, or hyphens

< ?php
// Delimiters may be slash, comma, or hyphen
$data = “Welcome to, the world of php”;
list($first, $second) = split(’[/,-]‘, $data);
echo “First Letter: $first; Second Splitted letter: $second
\n”;
?>

VN:F [1.5.7_846]
Rating: 0.0/10 (0 votes cast)
VN:F [1.5.7_846]
Rating: 0 (from 0 votes)
Share and Enjoy:
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google
  • De.lirio.us
  • Xerpi

No related posts.

Write a comment

Spam Protected