• Notice regarding image hosts and attachments. See here.

Some help converting ASP to PHP

Associate
Joined
13 Nov 2003
Posts
1,568
Location
Manchester
Hi All

Could someone help me out by converting this code into PHP. I am not familiar with ASP so not too sure how this code is working

Code:
<% originalproductcode = Replace(Left(recFroogle.Fields.Item("productcode").Value,Len(recFroogle.Fields.Item("productcode").Value)-3),".WP.","#")%><%=originalproductcode%>

I can change all the database stuff, not the replace section though.

Thanks in advance

Aaron
 
Any takers on this? I can do a standard replace in PHP but this one doesnt look standard. Its the '3' bit that confuses me

Thanks

EDIT

Looking at what the code needs to do, I dont think the '3' bit is required. The following code does the trick
Code:
$product_code = str_replace('#', '.WP.', $row['productcode']);
 
Last edited:
Back
Top Bottom