OiO.lk Community platform!

Oio.lk is an excellent forum for developers, providing a wide range of resources, discussions, and support for those in the developer community. Join oio.lk today to connect with like-minded professionals, share insights, and stay updated on the latest trends and technologies in the development field.
  You need to log in or register to access the solved answers to this problem.
  • You have reached the maximum number of guest views allowed
  • Please register below to remove this limitation

PHP variable changes by itself [closed]

  • Thread starter Thread starter Jonny
  • Start date Start date
J

Jonny

Guest
I lost several hours now, by trying to get it work.(Registrations for Events Calendar) I work in an external wordpress plugin and add some functionality. I have a variable as follows:

$jj_kosten_co21=explode("Anreise/CO2-Kosten",$jj_teil_der_mail_der_tourenleiter)[1];

If I print the content of $jj_kosten_co21, I get the result as it should be, which is: "Diesel/Benzin-PKW Fahrer: 0 € ..."

Now I do in a second step the follwoing:

$jj_kosten_co22=substr($jj_kosten_co21,0,50);

However now suddenly I get some completely different text for $jj_kosten_co22: "{Ich reise an mit: (benötigt für die"

The text I get is a placeholder that usually is shown if no value is set for the formular. However a value is set and the variable $jj_kosten_co21 before knows and prints the correct value.

I just get crazy...
<p>I lost several hours now, by trying to get it work.(Registrations for Events Calendar)
I work in an external wordpress plugin and add some functionality. I have a variable as follows:</p>
<p><code>$jj_kosten_co21=explode("Anreise/CO2-Kosten",$jj_teil_der_mail_der_tourenleiter)[1];</code></p>
<p>If I print the content of $jj_kosten_co21, I get the result as it should be, which is:
"Diesel/Benzin-PKW Fahrer: 0 € ..."</p>
<p>Now I do in a second step the follwoing:</p>
<p><code>$jj_kosten_co22=substr($jj_kosten_co21,0,50);</code></p>
<p>However now suddenly I get some completely different text for $jj_kosten_co22:
"{Ich reise an mit: (benötigt für die"</p>
<p>The text I get is a placeholder that usually is shown if no value is set for the formular. However a value is set and the variable $jj_kosten_co21 before knows and prints the correct value.</p>
<p>I just get crazy...</p>
Continue reading...
 

Latest posts

A
Replies
0
Views
1
Alvah_Franey
A
H
Replies
0
Views
1
habrewning
H
Top