Beginner Friendly · Hands-on · Free

Splits a string into smaller chunks.

chunk_split() function நாம் கொடுக்கும் string-ஐ smaller chunks-ஆக splits செய்வதற்கு பயன்படுகிறது.

5 min read Updated Dec 02, 2025

chunk_split() Function in PHP

chunk_split() function நாம் கொடுக்கும் string-ஐ smaller chunks-ஆக splits செய்வதற்கு பயன்படுகிறது.

chunk_split(string, length, separator);

Note: chunk_split() function-ல் string, length, separator arguments-ஆக அனுபப்படுகிறது. முதல் argument string இரண்டாவது chunks length, separator அடுத்தடுத்த argument- ஆக அமையும்.

Example1

<?php
$input = 'parallel codes php';
echo chunk_split($input,2);   
?>

மேலே உள்ள Example1-ஐ கவனிக்கவும் chunk_split() என்ற function-இல் $input என்ற variable-இல் 'parallel codes php' என்ற string மற்றும் chunks length argument-ஆக அனுப்பப்பட்டுள்ளது. இங்கு space மற்றும் character சேர்த்து இரண்டு chunks-ஆக splits செய்யபடுகிறது எனவே நமக்கு output pa ra ll el c od es p hp என கிடைக்கிறது.

Output:

pa ra ll el c od es p hp

Example2

<?php
$str = "php tamil";
echo chunk_split($str, 3, "... \n");   
?>

மேலே உள்ள Example2-ஐ கவனிக்கவும் chunk_split() என்ற function-இல் string மற்றும் chunks length, separator agrument-ஆக அனுபபடுகிறது. இங்கு output php... ta... mil... கிடைக்கிறது.

Output:

php... ta... mil...

இது பற்றிய தங்களின் கருத்துகளை இங்கே பதிவிடுங்கள் . இது பயனுள்ளதாக விரும்பினால் மற்றவர்களுக்கும் இதை share செய்யுங்கள்.