Re: can someone help me with this STUPID FUNCTION ISSUE

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Andrew,

Thank you for the advice.....I will try making the corrections and 
see what happens. I currently use tsWebEditor 2.0 but I am 
downloading Zend Studio and will give a shoot.

Over the past few years of coding I have noticed something and am 
wondering if anyone else have noticed this too.  If a PHP file 
becomes to big, parts are ignored.  I have had PHP files that are 100 
to 300 lines long and are solid code and parts of the code (more 
towards the bottom) start to be dropped off.  Is it possible that the 
server's cache fills up??

Jason
--- In php-objects@yahoogroups.com, "Andy Bartel" <andy@m...> wrote:
> Jason,
> 
> I doubt this is the issue, most likely just a miss when you put it 
in
> the email, but you're not closing your quotes in your actual script 
or
> ending with a semicolon on the first line when you first set 
$sys_msg.
> 
> Second, your function parse errors because you close the bracket 
after
> you run the first str_replace function rather than letting it 
continue.
> Again this may be an issue with copying your code to the email.
> 
> Third, there's no need for semi colons after bracket closes.
> 
> I added an echo statement and fixed the errors I mentioned and it 
runs
> flawlessly, try this:
> 
> <?
> 
> function msgformat ($msg)
> {
>   ($debug==true?"msgformat function called<br>":"");
>   $msg=str_replace("|NL|","<br>\n",$msg); //SET FOR NEW LINE
>   //Check for Date
>   if(strstr($msg,"|+D|")!=""){
>      $msg=str_replace("|+D|","<sub>",$msg); //TURN ON SUB FOR DATE
>      $msg=str_replace("|-D|","</sub>",$msg); //TURN OFF SUB FOR DATE
>   }
>   return $msg;
> }
> 
> $sys_msg="DEMO LOGINS|+D|(9/12/04)|-D||NL|"; 
> $sys_msg = msgformat($sys_msg);
> 
> echo $sys_msg;
> 
> ?>
> 
> It returns:
> 
> DEMO LOGINS(9/12/04) with the date "subbed".
> 
> I'm not sure which editing program you're using, but my Zend Studio
> picked up the error right away, you might want to consider switching
> apps.  If none of the things I said above work, check your include 
path,
> php version, etc.
> 
> Good luck,
> 
> -Andrew Bartel
> Web Applications Engineer
> Modulus, LLC
> 
> -----Original Message-----
> From: Jason [mailto:jason@h...] 
> Sent: Tuesday, September 14, 2004 7:38 PM
> To: php-objects@yahoogroups.com
> Subject:  can someone help me with this STUPID FUNCTION
> ISSUE
> 
> my code:
> //ON ONE PAGE
> <?php
> include ("includes/functions.php");
> $sys_msg="DEMO LOGINS|+D|(9/12/04)|-D||NL|
> $sys_msg = msgformat($sys_msg);
> ?>
> 
> //IN ANOTHER PHP FILE
> function msgformat ($msg)
> {
>   ($debug==true?"msgformat function called<br>":"");
>   $msg=str_replace("|NL|","<br>\n",$msg); //SET FOR NEW LINE
>   };
>   //Check for Date
>   if(strstr($msg,"|+D|")!=""){
>      $msg=str_replace("|+D|","<sub>",$msg); //TURN ON SUB FOR DATE
>      $msg=str_replace("|-D|","</sub>",$msg); //TURN OFF SUB FOR DATE
>   };
>   return $msg;
> };
> ....................................................
> 
> Now here is the problem.....nothing is happening.
> I have error_reporting on and am not getting any errors of any 
kind.  
> My php editing program, which checks for PHP errors and syntx 
> problems doesnt detect any issues.  My script knows that the 
function 
> exists and I think it calls to it but then it dies before running a 
> single line of code.
> 
> $sys_msg = msgformat($sys_msg);
> The above is returning NULL.
> 
> Any advice or help would be appreciated
> 
> 
> 
> 
> 
> PHP Data object relational mapping generator -
> http://www.meta-language.net/ 
> Yahoo! Groups Links



------------------------ Yahoo! Groups Sponsor --------------------~--> 
$9.95 domain names from Yahoo!. Register anything.
http://us.click.yahoo.com/J8kdrA/y20IAA/yQLSAA/saFolB/TM
--------------------------------------------------------------------~-> 

PHP Data object relational mapping generator - http://www.meta-language.net/ 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/php-objects/

<*> To unsubscribe from this group, send an email to:
    php-objects-unsubscribe@yahoogroups.com

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 




[Index of Archives]     [PHP Home]     [PHP Users]     [PHP Soap]     [Kernel Newbies]     [Yosemite]     [Yosemite Campsites]

  Powered by Linux