[FX.php List] str_replace " in $lookupResult ?

Vision Computer Consulting info at visioncomputerconsulting.com
Mon Apr 30 21:53:19 MDT 2007


Single quotes don't work because it takes what is inside '' as a  
literal instead of processing the expression.

Seems you want to escape the double quotes inside the double quotes.  
For example "The is the \"PHP\" value".

I was a Perl programmer I use $thephpexpression =preg_replace("/ 
\"/",'\"',$thephpexpression);

The put the value in the hidden input field to be  
value="$thephpexpression .

"
On Apr 30, 2007, at 8:34 PM, Alex Gates wrote:

> Greetings everyone-
> I was hoping someone could help me with my latest head-scratcher.
>
> I'm trying to send the results of a find to another page in a  
> hidden field
> via POST.
>
> But, I'm having problems when a double quote is in one of the  
> fields in
> my result.  My HTML thinks I am ending the value of my hidden field.
>
> When I use single quotes around my value like:
>
> <input type="hidden" name="recipes" value='<?php
> print_r($fixedlookuprecipesResult); ?>' />
>
> Something like, for example, half 'n half will end my value after  
> the '
>
> If I use double quotes around my value like:
> <input type="hidden" name="recipes" value="<?php
> print_r($fixedlookuprecipesResult); ?>" />
>
> Then something like cut into 1" thick slices will end my value  
> after the "
>
> I thought the answer lies with a str_replace, but I can't seem to  
> get it to
> work even though it is apparently possible to use an array as the  
> subject in
> a str_replace.
>
> With this find:
>
> 	$lookuprecipes=new FX($serverIP,$webCompanionPort,'FMPro7');
> 	$lookuprecipes->SetDBData('myDB.fp7','myLayout', 'all');
> 	$lookuprecipes->SetDBPassword('xxxxxxx','xxxxx');
> 	$lookuprecipesResult=$lookuprecipes->FMFindAll();
> 	
> I've tried:
>
> 	$fixedlookuprecipesResult = str_replace("' ", "/' ",
> $lookuprecipesResult);
>
> And:
> 	
> 	$fixedlookuprecipesResult = str_replace('" ', '/" ',
> $lookuprecipesResult);
>
> Nothing has worked.
>
> I'm assuming this doesn't work because, perhaps, it isn't looking  
> "deep"
> into the array - but, for example, searching $lookuprecipesResult 
> ['Recipe
> Ingredients'] gives me an undefined index error.
>
>
> Am I missing something obvious here?
> Any insight would be greatly appreciated!
>
> Thanks!
>
> Alex
>
> _______________________________________________
> FX.php_List mailing list
> FX.php_List at mail.iviking.org
> http://www.iviking.org/mailman/listinfo/fx.php_list
>



More information about the FX.php_List mailing list