# How to break up long words - PHP

**URL:** https://forum.kirupa.com/t/how-to-break-up-long-words-php/191884
**Category:** Uncategorized
**Created:** [June 23, 2006, 5:30pm UTC](https://forum.kirupa.com/t/how-to-break-up-long-words-php/191884 "2006-06-23T17:30:28Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![tanel96](https://avatars.discourse-cdn.com/v4/letter/t/5fc32e/32.png) [@tanel96](https://forum.kirupa.com/u/tanel96)
#### Post date: [June 23, 2006, 5:30pm UTC](https://forum.kirupa.com/t/how-to-break-up-long-words-php/191884/1 "2006-06-23T17:30:28Z")

</div>

If i have a variable:

$smth = “this is very extramegasupermammothgigantdifficult”;

Now in PHP i’m trying to write a code that searches that variable and inserts a whitespace into a word that is longer than eg. 25 characters… i know i should probably use [**[COLOR=#800080]ereg\_replace()[/COLOR]**](http://ee2.php.net/manual/en/function.ereg-replace.php) …

any ideas ?
