# PHP Error

**URL:** https://discourse.softpress.com/t/php-error/1489
**Category:** Dynamo
**Created:** [April 30, 2008, 4:53pm UTC](https://discourse.softpress.com/t/php-error/1489 "2008-04-30T16:53:22Z")
**Posts on this page:** 8
**Page:** 2

<div class="post-metadata">

### Author: ![WebWorker](https://discourse.softpress.com/letter_avatar_proxy/v4/letter/w/96bed5/32.png) [@WebWorker](https://discourse.softpress.com/u/WebWorker)
#### Post date: [May 1, 2008, 3:39pm UTC](https://discourse.softpress.com/t/php-error/1489/21 "2008-05-01T15:39:07Z")

</div>

Almost worked…

converted to an HTML entity OK, but only returned the first character ‘m’ of mail AT [domain.com](http://domain.com)

Now I’m totally lost.

* * *

dynamo mailing list  
email@hidden  
Update your subscriptions at:  
[http://freewaytalk.net/person/options](http://freewaytalk.net/person/options)

---

<div class="post-metadata">

### Author: ![waltd](https://discourse.softpress.com/user_avatar/discourse.softpress.com/waltd/32/2720_2.png) [@waltd](https://discourse.softpress.com/u/waltd)
#### Post date: [May 1, 2008, 3:48pm UTC](https://discourse.softpress.com/t/php-error/1489/22 "2008-05-01T15:48:58Z")

</div>

Make this line as follows:

```
$arr = preg_split('//',$string,-1,PREG_SPLIT_NO_EMPTY);

```

Make sure this is all one line, despite whatever well-meaning Mail  
does to it.

Also, your invocation is missing the closing tag for the a href:

`echo "<a href="mailto:$codedemail">Mail</a>";`

Walter

On May 1, 2008, at 11:25 AM, WebWorker wrote:

> ```
> $arr = (array) $string;
> 
> ```

* * *

dynamo mailing list  
email@hidden  
Update your subscriptions at:  
[http://freewaytalk.net/person/options](http://freewaytalk.net/person/options)

---

<div class="post-metadata">

### Author: ![WebWorker](https://discourse.softpress.com/letter_avatar_proxy/v4/letter/w/96bed5/32.png) [@WebWorker](https://discourse.softpress.com/u/WebWorker)
#### Post date: [May 1, 2008, 3:50pm UTC](https://discourse.softpress.com/t/php-error/1489/23 "2008-05-01T15:50:55Z")

</div>

Not wanting to change things but I found this on my PHP Reference widget

htmlentities()

Would this work?

* * *

dynamo mailing list  
email@hidden  
Update your subscriptions at:  
[http://freewaytalk.net/person/options](http://freewaytalk.net/person/options)

---

<div class="post-metadata">

### Author: ![WebWorker](https://discourse.softpress.com/letter_avatar_proxy/v4/letter/w/96bed5/32.png) [@WebWorker](https://discourse.softpress.com/u/WebWorker)
#### Post date: [May 1, 2008, 3:55pm UTC](https://discourse.softpress.com/t/php-error/1489/24 "2008-05-01T15:55:35Z")

</div>

Where do that go?

> On 1 May. 2008, 3:49 pm, waltd wrote:
> 
> Make this line as follows:
> 
> $arr = preg\_split(‘//’,$string,-1,PREG\_SPLIT\_NO\_EMPTY);

* * *

dynamo mailing list  
email@hidden  
Update your subscriptions at:  
[http://freewaytalk.net/person/options](http://freewaytalk.net/person/options)

---

<div class="post-metadata">

### Author: ![waltd](https://discourse.softpress.com/user_avatar/discourse.softpress.com/waltd/32/2720_2.png) [@waltd](https://discourse.softpress.com/u/waltd)
#### Post date: [May 1, 2008, 3:57pm UTC](https://discourse.softpress.com/t/php-error/1489/25 "2008-05-01T15:57:55Z")

</div>

It will only convert those characters that require encoding. Just as  
you found with rawurlencode(), that would consist mainly of the [at]  
sign. Everything else is a plain ASCII character, so it won’t be  
touched.

Walter

On May 1, 2008, at 11:50 AM, WebWorker wrote:

> Not wanting to change things but I found this on my PHP Reference  
> widget
> 
> htmlentities()
> 
> Would this work?
> 
> * * *
> 
> dynamo mailing list  
> email@hidden  
> Update your subscriptions at:  
> [http://freewaytalk.net/person/options](http://freewaytalk.net/person/options)

* * *

dynamo mailing list  
email@hidden  
Update your subscriptions at:  
[http://freewaytalk.net/person/options](http://freewaytalk.net/person/options)

---

<div class="post-metadata">

### Author: ![waltd](https://discourse.softpress.com/user_avatar/discourse.softpress.com/waltd/32/2720_2.png) [@waltd](https://discourse.softpress.com/u/waltd)
#### Post date: [May 1, 2008, 3:58pm UTC](https://discourse.softpress.com/t/php-error/1489/26 "2008-05-01T15:58:46Z")

</div>

Replace the first line inside the function, the one that currently  
starts with $arr = …

Walter

On May 1, 2008, at 11:55 AM, WebWorker wrote:

> Where do that go?
> 
> > On 1 May. 2008, 3:49 pm, waltd wrote:
> > 
> > Make this line as follows:
> > 
> > $arr = preg\_split(‘//’,$string,-1,PREG\_SPLIT\_NO\_EMPTY);
> 
> * * *
> 
> dynamo mailing list  
> email@hidden  
> Update your subscriptions at:  
> [http://freewaytalk.net/person/options](http://freewaytalk.net/person/options)

* * *

dynamo mailing list  
email@hidden  
Update your subscriptions at:  
[http://freewaytalk.net/person/options](http://freewaytalk.net/person/options)

---

<div class="post-metadata">

### Author: ![WebWorker](https://discourse.softpress.com/letter_avatar_proxy/v4/letter/w/96bed5/32.png) [@WebWorker](https://discourse.softpress.com/u/WebWorker)
#### Post date: [May 1, 2008, 4:06pm UTC](https://discourse.softpress.com/t/php-error/1489/27 "2008-05-01T16:06:58Z")

</div>

As yes of course! Seems it only converts HTML items not plain text.

We’re in Business, that line works, i’ll do some testing in the Paypal button later today. And dissect it to understand what is happening.

Thanks again.

> On 1 May. 2008, 3:57 pm, waltd wrote:
> 
> It will only convert those characters that require encoding. Just as  
> you found with rawurlencode(), that would consist mainly of the [at]  
> sign. Everything else is a plain ASCII character, so it won’t be  
> touched.

* * *

dynamo mailing list  
email@hidden  
Update your subscriptions at:  
[http://freewaytalk.net/person/options](http://freewaytalk.net/person/options)

---

<div class="post-metadata">

### Author: ![WebWorker](https://discourse.softpress.com/letter_avatar_proxy/v4/letter/w/96bed5/32.png) [@WebWorker](https://discourse.softpress.com/u/WebWorker)
#### Post date: [May 1, 2008, 5:26pm UTC](https://discourse.softpress.com/t/php-error/1489/28 "2008-05-01T17:26:08Z")

</div>

Success - all working correctly and emails hidden in 200+ Paypal buttons 🙂

Thanks Walt.

* * *

dynamo mailing list  
email@hidden  
Update your subscriptions at:  
[http://freewaytalk.net/person/options](http://freewaytalk.net/person/options)

[Previous page](https://discourse.softpress.com/t/php-error/1489.md?page=1)
