Small, short code snippets that other people may find useful. Do you have a good regex that you would like to share? Share it! Even better, the code can be commented on, and improved.
<?php
// with split length specified
echo str_split('abcdefghijklmnopq',2);
/*
Array
(
[0] => ab
[1] => cd
[2] => ef
[3] => gh
[4] => ij
[5] => kl
[6] => mn
[7] => op
[8] => q
)
*/
// without split length specified
echo str_split('abcdefghijklmnopq');
/*
Array
(
[0] => a
[1] => b
[2] => c
[3] => d
[4] => e
[5] => f
[6] => g
[7] => h
[8] => i
[9] => j
[10] => k
[11] => l
[12] => m
[13] => n
[14] => o
[15] => p
[16] => q
)
*/
?>
Last edited by feyd on Fri Aug 01, 2008 9:58 am, edited 5 times in total.
Reason:Fix php tags.
Set Search Time - A google chrome extension. When you search only results from the past year (or set time period) are displayed. Helps tremendously when using new technologies to avoid outdated results.
Set Search Time - A google chrome extension. When you search only results from the past year (or set time period) are displayed. Helps tremendously when using new technologies to avoid outdated results.
Ofcourse you can add this and other things that you have written to mimic PHP 5 behaviour. But this is again an option. I have found the for loop quite interesting in my programming career
Hope this is helpful.
Thanks
Jyot Vakharia
Last edited by feyd on Fri Aug 01, 2008 10:00 am, edited 2 times in total.
Reason:fix php tags and remove ad